我之前使用過其他主機,一切正常,但現在我已將其更改爲新的。在新主機上安裝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