I am trying to rewrite links with .htaccess file. Basic stuff, but for some reason it does not wor开发者_开发技巧k. I need the name of the file, before .php to be the last word in URL. What am I missing here?
RewriteRule ^/product/(.*)$ /incl/static/products/$1.php [NC,L]
as Marc
said you need something to distinguish the script file name and other parts:
RewriteRule ^products/script/(.*)/(.*)$ $1.php?$2&%{QUERY_STRING}
But if after first (.*) is query string , so use it:
RewriteRule ^products/script/(.*)$ $1.php?%{QUERY_STRING}
精彩评论