2016-03-07 32 views
0

我有以下.htaccess文件笨的.htaccess不會讓我的網址正確

<IfModule mod_rewrite.c>  

# Checks to see if the user is attempting to access a valid file 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 


</IfModule> 

我在本地主機上安裝它WAMP。通常這htaccess工作完美,但這次不是我不得不提到我的網址index.php。我檢查了Apache中啓用了mod_rewrite。我只是想知道我錯過了

+0

show application/config/config.php – cssBlaster21895

+0

$ config ['base_url'] \t ='';和$ config ['index_page'] ='index.php'; –

+0

好吧我通過重新安裝wamp來解決了這個問題,但我仍然無法弄清楚問題所在。 –

回答

1

嘗試......

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

試過了,不能正常工作 –

+0

可能會在你的配置文件中發出! – Kunal

+0

havbe你在配置中更改了這行? $ config ['url_suffix'] =''; – Kunal

0

$config['index_page'] = ''; //leave empty value 

刪除index.php文件,並設置

$config['base_url'] ='http//mydomain.com'; 

內的application/config /config.php。我認爲你的htaccess沒問題。

+0

是的,我已經改變了這些配置,仍然沒有工作 –

+0

也許它是你的具體情況。更改爲CI版本後。 3你必須從大寫字母,模型和控制器開始文件。你只有控制器問題嗎? – cssBlaster21895