remove index.php from urls using apache httpd.conf |
[eluser]omx[/eluser]
Hi, have viewed the wiki and after extensive googling I still can't get this to work... Have inserted the following into my httpd.conf file (and yes mod_rewrite.so is enabled) Code: <IfModule mod_rewrite.c> With this enabled I get a 404 when I point to: http://localhost/CodeIgniter/index.php/welcome Any ideas? Cheers!
[eluser]n0xie[/eluser]
Try to add this and see if this makes a difference Code: RewriteBase /CodeIgniter/ Also take a look here: http://codeigniter.com/wiki/mod_rewrite/
[eluser]danmontgomery[/eluser]
To expand on what n0xie said, you also need to remove the leading slash from index.php. You also should get rid of all of the /s in your RewriteCond line Code: <IfModule mod_rewrite.c> Depending on your host you may also need to add a ?: Code: RewriteRule ^(.*)$ index.php?/$1 [L] If apache won't start it's giving an error, to know that error would be much more useful then "it won't start".
[eluser]omx[/eluser]
Ok, in the end I just enabled .htaccess files to override conf and got it to work. Tried several permutations, how can I remove the CodeIgniter bit from the url? Code: RewriteRule ^(.*)$ /CodeIgniter/index.php?/$1 [L] So I end up with http://localhost/welcome instead of http://localhost/CodeIgniter/welcome Thanks!
[eluser]bretticus[/eluser]
Code: RewriteBase /CodeIgniter/ Depends on where your htaccess file is located. You should be able to use: Code: RewriteBase / if your htaccess file is in the CodeIgniter folder. If you have access to your apache config files (httpd.conf) then use virtualhosts and directory apache directives to specify exactly which directory (folder) the rewrite base refers to (plus it's much faster for apache.) Oh, and make sure that you have mod_rewrite enabled (reason for the error perhaps.) You can check with a simple phpinfo() call (look for apache2handler.) |
Welcome Guest, Not a member yet? Register Sign In |