我页面的路径就像wamp / www / a / b / c。在最后一个“c”文件夹中有一个.htaccess:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?p=$1 [L,QSA]
直到今天,它仍然有效,它将所有对localhost/a/b/c/path1/path2
的调用重定向到localhost/a/b/c/index.php?p=path1/path2
。但今天不再 - 像localhost/a/b/c/something
这样的所有调用都被重定向到localhost起始页面。我不知道为什么。我快速解决了将最后一行更改为
RewriteRule ^(.*)$ a/b/c/index.php?p=$1 [L,QSA]
知道如何解决这个问题(不要使用.htaccess文件中的路径)。
上次我没有更改任何服务器配置。
答案 0 :(得分:0)
这是因为您的RewriteBase
不正确。它应该反映DocumentRoot
的相对路径。使用此:
RewriteEngine on
RewriteBase /a/b/c/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?p=$1 [L,QSA]