2014-10-06 4 views
5

Probleme mit mod_rewrite in Fast-cgi-Umgebung für CodeIgniter. Mein .htaccess sieht so aus:So entfernen Sie index.php aus codeigniter in Fast-cgi

DirectoryIndex index.php 
    RewriteEngine on 
    RewriteCond $1 !^(index\\.php|images|css|js|robots\\.txt|favicon\\.ico) 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ /index.php?$1 [L] 

Aber ich habe einen Fehler 'Keine Eingabedatei angegeben'.

I geändert

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.* - [L] 

RewriteCond $1 !^(index\.php|images|robots\.txt) 
#RewriteRule ^(.*)$ /index.php?/$1 [QSA,L] 

<IfModule mod_php5.c> 
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

<IfModule !mod_php5.c> 
    RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 

Es funktioniert nur mit diesem auch:

#RewriteRule ^(.*)$ /index.php?/$1 [QSA,L] 

Mein Problem ist, dass ich immer noch die index.php auf die URL haben, wenn ich die Konfigurationsdatei geändert application/config/config.php aus $ config ['index_page'] = 'index.php'; nach $ config ['index_page'] = ''; Ich habe einen anderen Fehler.

Was mache ich falsch?

+3

fand ich die Lösung auf dem application/config/config.php Ich habe $ config ['uri_protocol'] = 'AUTO' geändert; zu $ config ['uri_protocol'] = 'REQUEST_URI'; – nandoC

Antwort

0

den Code in .htaccess

RewriteEngine on 
RewriteCond $1 !^(index\.php|resources|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

und config.php ändern hinzufügen

$config['index_page'] = 'index.php'; 

zu

$config['index_page'] = '';