重写规则的问题
有问题不要一开始就停止而是继续到第三条规则,问题就在这里。有几条线路规则,并以管理不适合任何内容的规则结尾。
当我禁用第三条规则时,/新闻将不起作用,但现在,规则 1 起作用。
第二条规则没有任何问题。
我已经检查过 news2.php?readmore=$1 之后的查询是否有循环,然后在 news2.php 上询问 news_cats.php,情况并非如此。
我还一直在查看 htaccess 文件中是否存在循环,但事实并非如此。
什么是问题?
RewriteRule ^news/([0-9]+)/[^/]*/?$ news2.php?readmore=$1 [L]
RewriteRule ^news_category/([0-9]+)/[^/]*/?$ news_cats.php?cat_id=$1 [L]
RewriteRule ^news news_cats.php [L]
There is problem with it do not stop at first but continues to the third rules, the problem is just here.; There is several line rules and ending with rules that manage that does not fit on anything.
When I disable 3rd rules will /news not work but now, rules 1 works.
There are not any problems with the second rules.
I have gone through whether there is a loop through the query after news2.php?readmore=$1 and then on news2.php ask for news_cats.php, that is not the case.
I've also been looking at whether there is a loop in the htaccess file that is not the case.
What is problem?
RewriteRule ^news/([0-9]+)/[^/]*/?$ news2.php?readmore=$1 [L]
RewriteRule ^news_category/([0-9]+)/[^/]*/?$ news_cats.php?cat_id=$1 [L]
RewriteRule ^news news_cats.php [L]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哦,我发现了错误。这是 htaccess 中的一个循环。
3条规则新闻不仅适合新闻,而且还可以捕获文件“news”2.php
解决方案。
Ooooh I've found the error. It is a loop in the htaccess.
3 rules news will fit not only news, but it would also capture the file "news"2.php
The solution.