.htaccess: clean URL with parameter "images" doesn't work -
I have yet to have figured out how to clean URL with .htaccess made but it seems that I direct a wall .. . I've got the following simple .htaccess:
RewriteRule ^ on RewriteEngine ([a-zA-Z0-9 -] +) $ index.php? id = $ 1 [L] RewriteRule ^ ([a-zA-Z0-9 -] +) / $ index.php? id = $ 1 [L]
expected as it mostly works: mysite .com / somepage goes to mysite.com/index.asp?id=somepage etc.
Except when the id is 'images'. When I try mysite.com/images it displays: mysite.com/images/?id=images (although the page still loads properly)
The way mysite.com/images/ (with a slash) works properly I am searching for a solution for the past few days and it is best to I can get it.
As Images
is a directory Apache mod_dir
Module adds a trailing slash after your rewriting rules. Can you stop slipping this feature and slash yourself behind it?
DirectorySlash add close RewriteEngine # slash RewriteCond% on {DOCUMENT_ROOT} / $ 1 -d RewriteRule ^ (* [^ /]) $% {REQUEST_URI} / [L, R = 302] RewriteCond % {REQUEST_FILENAME} -f RewriteRule ^ ([a-zA-Z0-9 -! ??] +) / $ index.php? id = $ 1 [L, Kyuesa]
Comments
Post a Comment