CodeIgniter Forums
Mod Rewrite not working for me - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Mod Rewrite not working for me (/thread-10430.html)

Mod Rewrite not working for me - El Forum - 07-30-2008

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:


Mod Rewrite not working for me - El Forum - 07-31-2008

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

Mod Rewrite not working for me - El Forum - 07-31-2008

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