htaccess problem

hehejo

Developer
Sep 22, 2009
803
12
18
Switzerland
www.peakinformatik.com
My current htaccess
RewriteEngine on
RewriteRule ^layer1/([^/\.]+)/?$ index.php?layer1=$1
RewriteRule ^layer1/([^/\.]+)/layer2/([^/\.]+)/?$ index.php?layer1=$1&layer2=$2
RewriteRule ^layer1/([^/\.]+)/layer2/([^/\.]+)/layer3/([^/\.]+)/?$ index.php?layer1=$1&layer2=$2&layer3=$3

I click on a link and the url changes to URL/folder/layer1/test/layer2/test2
So far so good. But when I click on another link it messes the url up to URL/folder/layer1/test/layer2/layer1/test/layer2/layer3/test3

So basically the html page thinks it is really in the last folder. The links are like a href="layer1/test", if I change it to a href="/layer1/test1" then it just goes to the root domain and doesn't go to the folder the page is in.

It's my first time playing around with htaccess as you can see... help plz :/