安裝了一個iWebshop程序在國外的空間,安裝一切正常,但是訪問首頁的時候發現,竟然是“No input file specified”錯誤。
其他頁面沒問題,方式index.php帶參數也沒問題,就是當直接訪問域名出現這個錯誤。
http://site/index.php 正常
http://site/ 出現以上錯誤
難道是默認首頁設置的問題?在cPanel下找了好久也沒找到哪里可以調整“默認首頁”,只好在“.htaccess”文件里面設置。
原來的“.htaccess”代碼為:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\.php|robots\.txt|views|plugins|backup|upload|image|runtime|install)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
改成:
<IfModule mod_rewrite.c>
DirectoryIndex index.php index.html
RewriteEngine off
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\.php|robots\.txt|views|plugins|backup|upload|image|runtime|install)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
就好了。