在我的開發工作站中訪問我的CodeIngniter項目時,一切都按預期工作,但只要我將其上傳到服務器(Dreamhost),它就會以純文本格式下載index.php文件當我不給任何參數的路徑。CodeIgniter不解析空路徑中的PHP
(家是默認控制器)
實施例:"site.com/home"
正確顯示該站點。
例如:"site.com/asd"
正確給404未找到。
例子:"site.com"
下載的index.php
我重寫規則去如下(非常標準的CI Dreamhost上):
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|humans\.txt|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]
任何想法?
PD:也許問題不是重寫規則:/ – levhita