Sunday, 11 August 2013

Htaccess rewrite index with trailing slash or without

Htaccess rewrite index with trailing slash or without

I am currently having a problem with my index url rewrite in my .htaccess
file, I know if I use
RewriteRule ^profile/([^/]*)/?$ /profile.php?x=$1 [L]
I would be able to use www.example.com/profile/get or
www.example.com/profile/get/ (with or without trailing slash)
But I would like www.example.com/get what I have so far is
RewriteRule ^([^/]*)\/$ /index.php?x=$1 [L]
But if I put a ? before the $ it errors any answers welcome

No comments:

Post a Comment