我有一個Code Igniter項目的小問題,我有一個.htaccess文件來重寫index.php。如果我把我的項目放在本地服務器上,它會很好用。我正在使用WAMP服務器。但是現在我已經將它上載到Live Server上(例如godaddy,00webhost)。它顯示錯誤: 404未找到頁面。找不到您請求的頁面。CodeIgniter .htaccess重寫不能在Live服務器上工作
我的.htaccess是在這裏:
RewriteEngine on
RewriteBase /directory_name/
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
和我的config.php文件設置是在這裏:
$config['base_url'] = 'http://example.com/directory/' ;
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
我已經嘗試了網絡上很多解決方案,但不幸運地找到一個誰幫助我。我3天后卡住了。任何人幫助我。
檢查是否在實時服務器上啓用了mod_rewrite模塊。 – Ravneet
檢查他們是否使用Apache? –
@Ravneet可以在現場服務器上檢查mod_rewrite模塊嗎? –