Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
请帮助我使用htaccess...
我有以下规则:
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ c.php [L,QSA]
据我了解,即使目录存在,这也应该重写,但由于我有 -Indexes 我收到 403 错误(访问被禁止),如果我有 +Indexes 我得到文件夹索引。
我想重定向到 c.php 甚至目录存在。
要将所有目录重定向到c.php文件,请使用以下指令:
RewriteCond %{REQUEST_URI} -d RewriteRule (.+) c.php [R,QSA]
要将所有不存在的文件重定向到c.php ,然后使用:
RewriteCond %{REQUEST_URI} !-f RewriteCond %{REQUEST_URI} !-d RewriteRule (.*) c.php [R,QSA]