2017-01-11 2 views
0

Hey Ich hatte Probleme mit Codeignitor "Datei nicht gefunden" in jedem Controller. Ich konfrontiert in auf Projekt, ich es fest, indem Sie diesen Code in .htacces setzenCodignator Error Datei nicht gefunden

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    # !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/ 
    RewriteBase/
    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> 

Dann wieder diese automatisch auf ein anderes Projekt konfrontiert.

+0

haben Sie index.php von config.php '$ config [ 'index_page'] = 'index.php' entfernt;' –

+0

@ NishantNair Ich habe bereits den anwser hinzugefügt –

+0

Mögliches Duplikat von (http://stackoverflow.com/questions/14214842/codeignit-mod-rewrite-gives-404-error) –

Antwort

0

Das Lösen von diesen Code in hatccess Quelle setzen: https://gist.github.com/philipptempel/4226750

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    # !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/ 
    RewriteBase/
    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>