我有文件结构
index.php .htaccess news/index.php news/.htaccess
第一个.htaccess:
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/news/ RewriteRule . /index.php [L]
第二(新闻/.htaccess)
RewriteEngine On RewriteRule . /index.php
请求http://test.t/news/news/61处理第一个index.php,但是第二个
我为第一个.htaccess尝试了更多选择,但未成功
解决方法:
检查您的Apache配置文件(httpd.conf),并确保您用于站点的目录包含AllowOverride选项.
例:
<Directory "/Applications/MAMP/htdocs">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>