开发者

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

开发者 https://www.devze.com 2023-02-01 17:12 出处:网络
So this is the question, I we tried RewriteRule ^(.*)/?$ /categories.p开发者_开发知识库hp?cat=$1

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

精彩评论

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

关注公众号