我的htaccess文件是。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} '.php$
RewriteRule ^(.*)$ first.php
现在我希望这个规则在我的管理文件夹中
不起作用就像我的管理员文件夹admin
所以当我的网址是admin/logout.php
然后不工作
RewriteCond %{REQUEST_FILENAME} '.php$
或者admin/ajax/ajax.php
那么它是一样的直接命中 to ajax.php
不重定向至 first.php
你的规则是这样的:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} '.php$
RewriteRule !^admin/ first.php [L,NC]
另一种简单的方法是使用以下语句将 .htaccess 文件放入您的管理文件夹中
RewriteEngine Off
这将禁用管理文件夹中的所有重写。