我之前使用过其他主机,一切正常,但现在我已将其更改为新的。在新主机上安装apache 2.4。mod_rewrite在apache 2.4上工作不正确
我的下一个规则:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase/
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^/?(.*) http://%1/$1 [L,R=permanent]
RewriteRule manage/ajax/(.*?)$ manage/ajax/index.php [QSA,L]
RewriteRule manage/json/(.*?)$ manage/json/index.php [QSA,L]
RewriteCond %{REQUEST_URI} !\.(.+)$
RewriteRule ckfinder/(.*?)$ ckfinder/index.html [QSA,L]
RewriteCond %{REQUEST_URI} !\.(.+)$
RewriteRule manage/(.*?)/$ manage/index.php [QSA,L]
RewriteCond %{REQUEST_URI} !\.(.+)$
RewriteRule ajax/(.+?) ajax/index.php [QSA,L]
RewriteCond %{REQUEST_URI} !\.(.+)$
RewriteRule api/(.*?) /api/index.php [QSA,L]
RewriteCond %{REQUEST_URI} !\.(.+)$
RewriteRule (.*) index.php
</IfModule>
当我尝试访问例如/管理/它告诉我的索引页,但如果我将一些额外的数据添加到路径它会告诉我我需要什么。例如:/manage/some_data - 工作正常。但我想通过/manage/访问正确的目录。
在你的.htaccess – anubhava
感谢的顶部,即固定我的问题只是用'的DirectoryIndex index.php'。 – user2058653
不客气,很高兴帮助。 – anubhava