Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)/ index.php?id=$1
So now I can get the variable "id" through $_GET["id"]
The problem is that it doesn't work when I put www.website.com/value in a browser (without the trailing slash) - I get the "not founded on this server" error. I've tried several options but I'm still not able to make it running properly. Can anyone help me please? Thank you.
So, the pattern must be improved, and the looping must be explicitly prevented:
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond $1 !^index\.php$
RewriteRule ^(.*)/?$ index.php?id=$1 [L]
Jim
You have 'with slash' and 'without slash' - I would add a 'slash' to 'without slash' redirect before the rewrite, and this redirect would also force the correct domain name.
You have 'dynamic' URL (yes, it still works!) and 'static' URL. You need a redirect for this too. Again, it is placed before the rewrite, and must force the correct domain name at the same time.
There are at least three steps needed to do the job properly. Currently you only have the third step.