Welcome Guest, Not a member yet? Register   Sign In
[Solved] mod_rewrite, index.php or how I will go crazy ...
#1

[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>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

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?
#2

[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).
#3

[eluser]laegnur[/eluser]
Hi

Yes, mod_rewrite is enabled. I enabled it with the a2enmod command, and I check it with a phpinfo page...
#4

[eluser]bitist[/eluser]
Read this post to enable mod_rewrite on Ubuntu:
#5

[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.
#6

[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...




Theme © iAndrew 2016 - Forum software by © MyBB