2013-10-25 66 views
0
<IfModule mod_rewrite.c> 
# Checks to see if the user is attempting to access a valid file, 
# such as an image or css document, if this isn't true it sends the 
# request to index.php 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ main.php/$1 [L] 
</IfModule> 

這是我的.htaccess,但我沒有得到正確的鏈接笨的.htaccess得不到寫

每當我點擊一個鏈接不具有的index.php其重定向到WAMP服務器主頁

+0

你必須解釋你的問題是什麼比這更好的。發生什麼事?什麼不是你期望的事情? – jmadsen

回答

0

試試這個:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/

    RewriteCond %{REQUEST_URI} ^sys.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

    RewriteCond %{REQUEST_URI} ^app.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

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

assumming是的index.php是你的索引頁。

,並在config.php變化

$config['index_page'] = '';