2017-03-05 41 views
0

我與GoDaddy託管使用笨3我的網站的一個問題,它的工作主要網頁,但是當我點擊鏈接它需要像www.example.com/index.php/submodule/subdir在godaddy上爲CodeIgniter 3託管的問題?

我不明白我怎麼能解決它,使用它像www.example.com/sumodule/subdir

我使用這個的.htaccess文件

<IfModule mod_rewrite.c> 
Options +FollowSymLinks 
Options -Indexes 
DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $l !^(index\.php|images|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$l [L,QSA] 
</IfModule> 
<IfModule !mod_rewrite.c> 
ErrorDocument 404 /index.php 
</IfModule> 
+0

請檢查[這個答案](http://stackoverflow.com/questions/28682210/how-to-remove-index-php-with-codeigniter-in-godaddy-com#answer-28682743)如果是對你有幫助。 – Tpojka

+0

如果您正在使用mod_rewrite刪除頁面,請將此變量設置爲空白。 $ config ['index_page'] =''; – Vickel

+0

確保您已將hta​​ccess放置在主應用程序文件夾的外面。 – user4419336

回答

1

使用這.htaccess文件和.htaccess文件必須是外笨application文件夾

RewriteEngine On 

    RewriteBase/

    RewriteCond %{REQUEST_FILENAME} !-f 

    RewriteCond %{REQUEST_FILENAME} !-d 

    RewriteRule ^(.*) /index.php?/$1 
+0

index.php我放置它...它的工作正常但不喜歡www.example.com/submodule/subcontrollers ..仍然我需要把它像www.example.com/index.php/submodule/subcontrollers – AwesomeMe

+0

也我正確設置所有的配置變量..如索引是空的..和Uri是AUto – AwesomeMe

+0

你在codeigniter結構中使用HMVC還是其他的? –