.htaccess:无法添加两个规则

时间:2017-05-21 14:52:10

标签: php .htaccess url-rewriting

我有两个规则 - 第一个是删除URL中的子目录(也删除.php扩展名),第二个是删除404.php页面中的.php扩展名。

  

第一条规则:RewriteRule ^(.*)$ pages/$1/$1.php [L,QSA] - >哪一个   从localhost/root/pages/student/student.php转换为   localhost/root/student

     

第二条规则:RewriteRule ^404/?$ 404.php [NC,L] - >哪一个   从localhost/root/404.php转换为localhost/root/404

只有在评论了其他规则但我无法使这两项规则发挥作用时,两者都有效。

有人能帮助我吗?我现在已经挣扎了近一天。

提前致谢。

0 个答案:

没有答案