I have a problem with codeigniter and the .htaccess, I have been looking for an answer here but I can’t find it, so I would thank any help on this 🙂
On my index.php, the first line is this one:
echo var_dump($_SERVER['REQUEST_URI']);
die();
My .htaccess is this one:
ErrorDocument 404 /error
# Set default charset
AddDefaultCharset utf-8
RewriteEngine On
# From non-www to www
RewriteCond %{HTTP_HOST} ^paravegetarianos\.com$ [NC]
RewriteRule ^(.*)$ http://www.paravegetarianos.com/$1 [R=301,L]
# General
RewriteBase /
RewriteCond %{REQUEST_URI} !^(.+)\.(js|css|gif|png|jpg|jpeg|bmp|swf|txt|xml|htc|pdf|xls|doc|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L,QSA]
And when I put on the browser to this url:
http://www.paravegetarianos.loc/comunidad/jonaypelluz/albums/danna/ca_1
it will redirect to:
http://www.paravegetarianos.loc/danna
and it will print:
string '/danna' (length=6)
and this is the line in the access.log:
127.0.0.1 - - [28/Oct/2011:21:56:12 +0200] "GET /danna HTTP/1.1" 200 123
I suppose my rewriting rules are not working properly 🙂 Thanks!
As already said, i think you must look elsewhere than in the codes you gave because i can’t see nothing wrong with it.
If you are using routing feature, check the custom routes settings in /config/routes.php.