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

Reply via email to