2015-05-29 169 views
1

我最近搬到了godaddy Linux主機,而.htaccess似乎沒有工作。是否有任何需要爲godaddy完成的設置,因爲.htaccess在本地xampp服務器以及hostek server上工作。我得到「404 Not Found」錯誤消息。我使用的CodeIgniter-2.2.1框架也有在php.ini文件中檢查加載模塊中的mod_rewrite未在服務器端啓用。Codeigniter htaccess不能在godaddy上工作?

我的htaccess文件位於我的應用程序部署的根目錄。

RewriteEngine On 
RewriteCond $1 !^(index\.php|resources|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

請建議。

+0

的[問題可能重複使用CodeIgniter和URI上GoDaddy服務器](http://stackoverflow.com/questions/5725358/problem-with-codeigniter-and-uri-on-godaddy-serve rs) – user4419336

+0

登陸頁面也顯示'404'錯誤? – Girish

+0

我已經嘗試給出了堆棧溢出討論的解決方案,它不適合我。因此,我分享我的應用程序設置和httaccess來找出問題。 –

回答

1

這是我的工作:

RewriteEngine On 
RewriteCond $1 !^(index\.php|resources|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L,QSA] 
0

使用本

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

在config.php

$config['base_url'] = ""; 
$config['index_page'] = ""; 
$config['uri_protocol'] = "AUTO"; 

編輯01

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 
+0

我試過但同樣的錯誤消息,似乎它不工作。 –

+0

檢查**編輯01 ** –

+0

同樣的錯誤編輯01 –

0

改變你的

RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

喜歡

RewriteRule ^(.*)$ index.php?/$1 [L,QSA] 
+0

得到相同的錯誤信息。 –

+0

刪除緩存 –

0

在Godaddy的工作一個共享:

RewriteEngine on 
RewriteBase/
Options -Indexes 
RewriteCond $1 !^(index\.php|resources|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/\?$1 [L] 
0
<ifmodule mod_rewrite.c> 

    # !IMPORTANT! Set your RewriteBase here and don't forget trailing  and leading 
    # slashes. 
    # If your page resides at 
    # http://www.example.com/mypage/test1 
    # then use 
    # RewriteBase /mypage/test1/ 

RewriteEngine on 
RewriteCond $1 !^(index\.php|resources|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /path_to/your_website/index.php?$1 [L,QSA] 
</IfModule> 
+0

是這裏的xml標籤不區分大小寫? – YakovL

相關問題