CodeIgniter Forums
Problem with .htaccess on localhost - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with .htaccess on localhost (/showthread.php?tid=11365)



Problem with .htaccess on localhost - El Forum - 09-05-2008

[eluser]Bramme[/eluser]
Hey all,

I'm experiencing some trouble with my .htaccess file on my localhost, running Ubuntu Hardy Heron. I've created my .htaccess file:
Code:
Options -Indexes
Options +FollowSymLinks

DirectoryIndex index.php
<IfModule mod_rewrite.c>
    RewriteEngine on
    
    RewriteCond $1 !^(index\.php|_assets)

    RewriteCond %{REQUEST_FILENAME} !index.php
    RewriteRule (.*)\.php$ index.php/$1
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
    
</IfModule>
<IfModule !mod_rewrite.c>
    ErrorDocument 404 index.php
</IfModule>
I go to localhost, I see the standard welcome, I go to localhost/index.php?/welcome/ all is still fine. I go to localhost/welcome/ and I see a complete white page, with only two words in it: "index.php"

Does anybody know what could be causing this?


Problem with .htaccess on localhost - El Forum - 09-06-2008

[eluser]Bramme[/eluser]
Nobody got a clue? it's kind of annoying...


Problem with .htaccess on localhost - El Forum - 09-06-2008

[eluser]Pascal Kriete[/eluser]
I don't know what's causing it, but it might be fixed by adding the ? to your htaccess:
Code:
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]



Problem with .htaccess on localhost - El Forum - 09-06-2008

[eluser]phantom-a[/eluser]
hmm, I would help you if I could, my .htaccess doesn't work at on my local dev. I think becuase vista sucks haha


Problem with .htaccess on localhost - El Forum - 09-07-2008

[eluser]Bramme[/eluser]
[quote author="inparo" date="1220765903"]I don't know what's causing it, but it might be fixed by adding the ? to your htaccess:
Code:
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
[/quote]That fixes it indeed, but it's not really what I was aiming for. I'll use it for now! Thanks.


edit: okay, very weird. the rewrite_module was simply not enable in wamp server. Apparently that caused the error... Still weird it would redirect certain pages then...


Problem with .htaccess on localhost - El Forum - 09-07-2008

[eluser]Crafter[/eluser]
Check your default apache configuration. It's quite possible that Apache does not allow you to use an .htaccess file.

You need to have something like
Code:
<Directory /website/rootdir/>
                ...
                # AllowOverride None  <-- This is the default. Set it as below
                AllowOverride All
                ...
</Directory>