Rewriting url & .htaccess

From: Date: Tue, 08 May 2018 18:16:24 +0000
Subject: Rewriting url & .htaccess
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-26977@lists.php.net to get a copy of this message
Dear all, After having watched some tutorials on youtube concerning rewriting url, I would like you to give your explanations about this case: - Using the 3 following files, I would like to get the url :"http://localhost/test/user/2" instead of "http://localhost/test/user.php?id=2" But I obtain that message in a new page (french)" Cette page ne fonctionne pas localhost vous a redirigé à de trop nombreuses reprises. * Essayez de supprimer les cookies.<https://support.google.com/chrome?p=rl_error&hl=fr>. ERR_TOO_MANY_REDIRECTS ===> Could you please tell me what are the whole solutions of this case (supposing cookies have properly been deleted and php.ini and httpd.conf are well set) ? test.php : <font face="century gothic" size="20px"> <center>Hello World</center> </font> <?php $i=1; while($i<=10){ echo"<a href='user.php?id=$i'>User ".$i."</a><br>"; $i++; } include 'style.css'; ?> user.php: <?php if(!isset($_GET['id'])){ header('location: test.php'); } else if (isset($_GET['id'])) { echo "User ID : ". $_GET['id']."<br>"; } include 'style.css'; ?> ..htaccess: RewriteEngine On RewriteRule ^test?$ test.php RewriteRule ^user/([0-9]+)$ user.php?id=$1 [L] Thanks a lot, Best Regards, Charly EVEILLARD Creator of the website : www.lablogosphere.fr

« previous php.webmaster (#26977) next »