Having problems with mod_rewrite in Fast-cgi environment for CodeIgniter. My .htaccess looks like this :
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]
But I got an error ‘No input file specified’.
I changed to
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>
It works only with this one also :
#RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]
My problem is that I still have the index.php on the URL, if I changed the configuration file application/config/config.php from $config['index_page'] = 'index.php'; to $config['index_page'] = ''; I have a different error.
What I do wrong ?
add the 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]
and config.php file change
$config['index_page'] = 'index.php';
to
$config['index_page'] = '';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With