Hi, I am trying to get site.com/variable to rewrite to site.com/index.php?id=variable
This is the code I have that is working
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^id/([^/]+)/?$ index.php?id=$1 [L]
But this doesn't work with the id folder removed:
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([^/]+)/?$ index.php?id=$1 [L]
What am I doing wrong? Also, I noticed that you can put as many forward slashes in the url and it still rewrites, I don't want this to happen.
site.com/id////variable//// -------> site.com/index.php?id=variable
If anyone could give me a couple of pointers that would be great!
Thanks
Last edited by todorov; 04-30-2009 at 07:42 AM..
|