Click to See Complete Forum and Search --> : mod_rewrite


artemis
05-14-2008, 01:50 PM
Hi, I'm getting very confused with mod_rewrite.. what i want is to redirect all requests to the main domain to a folder i.e.

www.example.com/index.php
Go's to:
www.example.com/folder/index.php

(I don't want the folder name to be visible)
I keep on getting internal server errors though, the code is:

RewriteRule ^(.*) /folder/$1 [L,QSA]

Thanks!

bokeh
05-14-2008, 02:45 PM
That's going to loop infinitely.You need a rewrite condition to stop that.

artemis
05-14-2008, 03:06 PM
Yeah I know, I got this now:

RewriteCond %{REQUEST_URI} !^/cgcu/
RewriteRule ^(.*)$ /cgcu/$1 [L]


Except the homepage gives an internal server error for some reason..