你有一个.htaccess
文件位于您的管理目录中,还是仅位于根目录中?每个目录中都需要有一个。
我刚刚用你的测试了这个.htaccess
in /htdocs/pro
和相同的.htaccess
in /htdocs/pro/admin
它的工作原理完全按照你的解释。
根 htaccess 在/htdocs/pro/.htaccess
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
管理员 htaccess 在/htdocs/pro/admin/.htaccess
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
两个的单个 htaccess 文件/htdocs/.htaccess
or /htdocs/pro/.htaccess
Options -Indexes
RewriteEngine on
# Change '/pro/' if directory is renamed
RewriteBase /pro/
# Change the '/pro/' portion of the condition if directory is renamed
RewriteCond %{REQUEST_URI} ^/pro/admin(.+)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ admin/index.php?url=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]