开发者

Rewriting link with .htaccess

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}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜