0

http://codeigniter.com/user_guide/general/urls.html
I am using a MAMP setup I access my codeigniter welcome message as follows

http://localhost:8888/CodeIgniter_2.0.2/index.php/welcome

the tutorial says

use a .htaccess file as

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

to get same message with

http://localhost:8888/CodeIgniter_2.0.2/welcome

but I get a 404 not found error instead

2
  • Are you using Apache ? Also mention your OS. Commented Aug 12, 2011 at 16:52
  • 2
    There's so many of these questions on SO and CI Forums, CI's docs say it's simple but so many people have followed the instructions to the T and have had problems Commented Aug 12, 2011 at 16:58

4 Answers 4

0

Try to add RewriteBase on your htacces file.

RewriteEngine On
RewriteBase "/CodeIgniter_2.0.2/"
...your rules here...
Sign up to request clarification or add additional context in comments.

Comments

0

the last line should be

RewriteRule ^(.*)$ index.php/$1 [L]

and not

RewriteRule ^(.*)$ /index.php/$1 [L]

Comments

0

First things first, you need to check your httpd.conf
Look for this line.. (the location may not be the same)

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

Make sure it's uncommented. Then save your changes and restart apache server.

Also, make sure that the .htaccess file is in the same directory as your index.php.
It's usually the base directory of your CodeIgniter application.

EDIT:

Also forgot to mention that you need virtual hosts for this work seamlessly.
Argh, it seems your question is a repost. Here's another question but this is on a MAC OS X platform, with some detail on setting up your virtual hosts.
Remove "index.php" from URL - Codeigniter

Comments

0

the instructions you followed assume you are installing code igniter in the docroot, and not a subdirectory. move all your files in /CodeIgniter_2.0.2 down a directory.

mv CodeIgniter_2.0.2/* .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.