[Solved] mod_rewrite, index.php or how I will go crazy ... |
[eluser]laegnur[/eluser]
Hi I have a development server with apache2, php and mysql under ubuntu jaunty. In the ServerRoot I have a folder called "artabro" and into it, the codeigniter installation. In "artabro" I have the next .htaccess too: Code: <IfModule mod_rewrite.c> In the codeigniter's config.php, I have changed the base_url to "http://localhost/artabro/", the index_page to "" and the uri_protocol to "REQUEST_URI" If I access to http://localhost/artabro or http://localhost/artabro/index.php/welcome/ it shows the welcome class without problem. But if I tried to access to http://localhost/welcome it don't works... The apache log said that: "Files does not exist: /var/www/artabro/welcome" I don't know what more do to fix this... Someone can help me?
[eluser]Ben Edmunds[/eluser]
First thing I would do is make sure mod_rewrite IS enabled. Doing that in ubuntu is a little weird, you copy the rewrite.mod file to your enabled mods folder under apache2 (if it isn't already there).
[eluser]laegnur[/eluser]
Hi Yes, mod_rewrite is enabled. I enabled it with the a2enmod command, and I check it with a phpinfo page...
[eluser]wiredesignz[/eluser]
RewriteBase path is incorrect, it must be set to the directory that contains index.php ErrorDocument path is also incorrect. In fact the ErrorDocument section should be removed completely. It's job is to redirect "page not found" if mod_rewrite is disabled.
[eluser]laegnur[/eluser]
I have it! It works!. Thanks all for your answers... It's a noob mistake... I forget to change the AllowOverride none to all in the default file in sites enabled... And yes, the RewriteBase was incorrect, I finally put it to /artabro/ and works correctly... |
Welcome Guest, Not a member yet? Register Sign In |