开发者

How to url rewrite /categories.php?cat=cat_name into /name_catname/?

So this is the question, I we tried RewriteRule ^(.*)/?$ /categories.p开发者_开发知识库hp?cat=$1 but it gives me error 500


I think your problem is that you are getting stuck in an infinite loop. Once the url is re-written, mod_rewrite starts over with all of the rules. So you either need to add a RewriteCond to exclude categories.php, or you might be able to use the L flag to signal that this is the last rule:

RewriteRule ^(.*)/?$ /categories.php?cat=$1 [L]

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜