Welcome Guest, Not a member yet? Register   Sign In
Problem with .htaccess on localhost
#1

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

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

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

[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
#5

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

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




Theme © iAndrew 2016 - Forum software by © MyBB