Welcome Guest, Not a member yet? Register   Sign In
Rewritebase bummer
#1

[eluser]joeizang[/eluser]
hi y'all,

Please I am uploading my first CI based site (actually my first site ever). i used the wiki to work on removing the index.php file using the DreamHost .htaccess solution 2. but I just get a 404 error, a codeigniter 404. Now I don't understand the RewriteBase Directive. what folder location am i supposed to add to the rewritebase directive. all my files are in the:
root folder of the site so my structure is:

/
/application
/system
index.php
please help.
#2

[eluser]Ben Edmunds[/eluser]
Your rewrite base should be / from your htaccess but you shouldn't need to set that in your htaccess. Where are you defining this? In htaccess or in httpd.conf?

What do you have now?
#3

[eluser]joeizang[/eluser]
just .htaccess not in httpd.conf. so I don't have to set the rewritebase directive. let me just paste my .htaccess:


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>
#4

[eluser]Ben Edmunds[/eluser]
You shouldn't need the RewriteBase in your htaccess, but it isn't hurting anything. But you do need to verify with your host that mod_rewrite is enabled.
#5

[eluser]joeizang[/eluser]
oh i put a phpinfo file and checked: no support for mod_rewrite. so it means that the site has to have the index.php file in the address at all times?

Thanks
#6

[eluser]Ben Edmunds[/eluser]
I did some googling and dreahost does support mod_rewrite so you probably just have to turn it on somewhere.

I've never used dreamhost so I don't know where to tell you to do that but it should be possible.
#7

[eluser]Aken[/eluser]
Try adding a forward slash before index.php in your RewriteRule. I have a nearly identical .htaccess file which works fine, except mine has the slash. Not sure if that's the cause, but it can't hurt to try.

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>




Theme © iAndrew 2016 - Forum software by © MyBB