.htaccess 文件表现得很奇怪
我正在创建 CMS,但 .htaccess 文件出现问题,
RewriteRule ^([-az]+)*/([-a-z_]+)*/$ ./page.php?page 之后的行=$1&order=$2
无论如何都不起作用...
我做错了什么?
PS这是我的完整代码:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([-a-z]+)*/$ ./page.php?page=$1
RewriteRule ^([-a-z]+)*/([-a-z_]+)*/$ ./page.php?page=$1&order=$2
RewriteRule ^blog-entry/([-a-z-0-9]+)*/$ ./single.php?post=$1&page=blog
RewriteRule ^blog/(\d+)*/$ ./page.php?page=blog&num=$1
I am creating a CMS and having trouble with my .htaccess file, the line following
RewriteRule ^([-a-z]+)*/([-a-z_]+)*/$ ./page.php?page=$1&order=$2
will not work no matter what...
What am I doing wrong?
P.S. Here is my full code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([-a-z]+)*/$ ./page.php?page=$1
RewriteRule ^([-a-z]+)*/([-a-z_]+)*/$ ./page.php?page=$1&order=$2
RewriteRule ^blog-entry/([-a-z-0-9]+)*/$ ./single.php?post=$1&page=blog
RewriteRule ^blog/(\d+)*/$ ./page.php?page=blog&num=$1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该将最后 2 条规则放在前面,因为它们更具体,并且前 2 条规则将在后两条规则之前匹配。
You should put those last 2 rules first, as they are more specific, and the prior 2 rules will match before the latter ones.