CodeIgniter Forums

Full Version: Mod Rewrite not working for me
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hello, I've done all of the steps listed on the CI Wiki ( and I'm successfully able to pull up the default controller and view by simply typing in the server IP address.

So, this works: (pulls up my index page fine)
However, this does NOT: (404 not found)

My configuration looks like this:

/var/www/... <-- everything is contained within this folder, see below

CodeIgniter is installed in system/, so:

Any idea why I can't open smiley.gif from the images/ folder when typing in ?

Thanks :cheese:


El Forum

You can access to this file because all the requests are redirected to index.php by default and try to execute this function on your main controller class. When codeigniter receives, it try to execute function images with smiley.gif and how this function doesn't exists you can obtain this image.

This is why you must create an .htaccess file on the www directory, like this:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ index.php [L]
RewriteCond $1 !^(index.php|media|img|javascript|css|robots.txt|favicon.ico|images)
RewriteRule ^(.*)$ index.php/$1 [L]

Then you can access to all the files listed between brackets.

I hope this works for you

El Forum

libnac: excellent! this works perfectly, you're a saint!