[英]Apache htaccess RewriteRule not working with specific word
I have 2 RewriteRule.我有 2 个 RewriteRule。
1.RewriteRule ^page/([^\.]*)/ page.php?_path=page_detail&id=$1 [QSA,L]
2.RewriteRule ^page2/([^\.]*)/ page.php?_path=page_detail&id=$1 [QSA,L]
When I test with the URL localhost/page2/1/about
.当我使用 URL
localhost/page2/1/about
。
I have got print_r($_GET)
and it redirects the complete URL page.php?_path=page_detail&id=1
我有
print_r($_GET)
并且它重定向了完整的 URL page.php?_path=page_detail&id=1
When I test with the URL localhost/page/1/about
.当我使用 URL
localhost/page/1/about
。
Its not working.它不工作。 I didnt get
print_r($_GET)
.我没有得到
print_r($_GET)
。 But it only shows blank page.但它只显示空白页。
I don't understand why if I use the word "page" it won't work.我不明白为什么如果我使用“页面”这个词就行不通了。
如果它对名称敏感,则可能是您的 htaccess 只接受文件夹的名称...这意味着如果开头的 page2 或 page1 仅在文件夹具有该名称时才有效...我尝试检查最终解决方案,但是你可能会坚持使用文件夹的名称
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.