我有两个规则 - 第一个是删除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
只有在评论了其他规则但我无法使这两项规则发挥作用时,两者都有效。
有人能帮助我吗?我现在已经挣扎了近一天。
提前致谢。