2011-04-25 68 views
0

不知道是否有人可以幫助解決這個.htaccess問題 - 我已經工作了幾個月,現在它停止工作後,我的一些愚蠢的刪除錯誤,但現在不知道如何分類這個問題。htaccess文件刪除CodeIgniter中的index.php - 500內部服務器錯誤

如果有人可以幫助它將不勝感激!

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase /MMSFL/ 

    #Removes access to the system folder by users. 
    #Additionally this will allow you to create a System.php controller, 
    #previously this would not have been possible. 
    #'system' can be replaced if you have renamed your system folder. 
    RewriteCond %{REQUEST_URI} ^system.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 
     
    #When your application folder isn't in the system folder 
    #This snippet prevents user access to the application folder 
    #Submitted by: Fabdrol 
    #Rename 'application' to your applications folder name. 
    RewriteCond %{REQUEST_URI} ^application.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

    #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 ^(.*)$ index.php?/$1 [L] 
</IfModule> 

<IfModule !mod_rewrite.c> 
    # If we don't have mod_rewrite installed, all 404's 
    # can be sent to index.php, and everything works as normal. 
    # Submitted by: ElliotHaughin 

    ErrorDocument 404 /index.php 
</IfModule>  

回答

2

一對夫婦在這裏所做的更改嘗試一下,看看,如果這個工程:

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /MMSFL/ 

#Removes access to the system folder by users. 
#Additionally this will allow you to create a System.php controller, 
#previously this would not have been possible. 
#'system' can be replaced if you have renamed your system folder. 
RewriteCond %{REQUEST_URI} ^system.* 
RewriteRule ^(.*)$ /index.php/$1 [L] 

#When your application folder isn't in the system folder 
#This snippet prevents user access to the application folder 
#Submitted by: Fabdrol 
#Rename 'application' to your applications folder name. 
RewriteCond %{REQUEST_URI} ^application.* 
RewriteRule ^(.*)$ /index.php/$1 [L] 

#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 ^(.*)$ index.php/$1 [L,QSA] 
</IfModule> 

<IfModule !mod_rewrite.c> 
# If we don't have mod_rewrite installed, all 404's 
# can be sent to index.php, and everything works as normal. 
# Submitted by: ElliotHaughin 

ErrorDocument 404 /index.php 
</IfModule> 

另外,還要確保你的目錄是否正確。 (在RewriteBase中)

+0

感謝布蘭登,我簡直就是在幾秒前就修好了。但是這也會奏效:)非常感謝你的回答! – 2011-04-25 15:46:40

+0

ajh_8你做了什麼。好心解釋。 – 2012-07-14 10:27:33

+0

路由中的最後一行ifmodule - > RewriteRule ^(。*)$ index.php/$ 1 [L,QSA] – BrandonS 2012-07-16 16:56:54