我正在將現有的codeigniter網站從MediaTemple共享服務器移動到Dreamhost VPS服務器。我已經建立了新服務器的鏡像來查看站點而無需切換DNS;你可以看到它herecodeigniter站點在服務器移動後返回404錯誤
我試圖切換DNS,但問題依然存在。
正如你所看到的,它返回一個404錯誤。如果我刪除了htaccess文件,主頁將會出現,但是沒有一個html頁面可以工作。我認爲這與htaccess文件中的RewriteCond和RewriteRule語句有關。
這裏是htaccess文件:
AddHandler php-stable .php
php_flag allow_url_fopen on
# php_flag extension_dir=/home/86983/data/lib/php
# php_flag extension=zip.so
Options +FollowSymLinks
RewriteEngine on
# RewriteCond $1!^(js|css|images|license\.txt|user_guide|admin|phpMyAdmin|uploads|ornaments_sitemap2_25_09\.xml|sitemap\.xml|robots\.txt|quickscript\.php|paypal_ipn\.php|test\.php|sitedown\.php)
# RewriteRule ^(.*)$ http://www.ornaments.com/sitedown\.php [L]
RewriteCond %{HTTP_HOST} ^ornaments\.com$ [NC]
RewriteRule (.*) http://www.ornaments.com/$1 [R=301,L]
RewriteCond $1 !^(admin|backupForPhpMyAdmin|blog|change_page_name\.php|css|favicon\.ico|images|index\.php|js|license\.txt|ornaments_sitemap2_25_09\.xml|paypal_ipn\.php|phpMyAdmin|uploads|quickscript\.php|robots\.txt|sitemap\.xml|sub-domains|test\.php|testblog\.php|url_checker|user_guide|tinymy\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]
# RewriteCond %{HTTP_HOST} ^s86983\.gridserver\.com$ [NC]
# RewriteRule (.*) http://www.s86983\.gridserver.com/$1 [R=301,L]
#
# RewriteCond $1 !^(blog|index\.php|js|css|images|license\.txt|user_guide|admin|phpMyAdmin|uploads|ornaments_sitemap2_25_09\.xml|sitemap\.xml|robots\.txt|quickscript\.php|paypal_ipn\.php|test\.php|backupForPhpMyAdmin)
# RewriteRule ^(.*)$ /index.php/$1 [L]
注:我沒有建立這個網站,我只是稍微熟悉一般的笨和PHP。任何幫助將不勝感激。
嘗試從您的.htacces文件中刪除前兩行 –
我刪除了前兩行,現在當我刷新頁面時得到此消息:「沒有指定輸入文件。」 – user3403950