Welcome to WebmasterWorld Guest from 54.146.171.44

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

rewrite only partially working

   
8:35 pm on Dec 21, 2012 (gmt 0)



I have the following rewrite rules:

RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/(.*)$ page3.php?var1=$1&var2=$2&var3=$3
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ page2.php?var1=$1&var2=$2
RewriteRule ^([a-zA-Z0-9_-]+)$ page1.php?var1=$1

This part is working fine:
www.mysite.com/aaa
==> goes to page1.php

www.mysite.com/aaa/bbb
==> goes to page2.php

www.mysite.com/aaa/bbb/ccc
==> goes to page3.php

So far so good, but:
www.mysite.com/aaa/
==> page not found error

www.mysite.com/aaa/bbb/
==> goes to page3.php not to page2.php?

www.mysite.com/aaa/bbb/ccc/
==> goes to page3.php

I would like
www.mysite.com/aaa/ to be rewritten as www.mysite.com/aaa
www.mysite.com/aaa/bbb/ to be rewritten as www.mysite.com/aaa/bbb
www.mysite.com/aaa/bbb/ccc/ to be rewritten as www.mysite.com/aaa/bbb/ccc

But How?
Any help is appreciated;-)

Thanks,
Dirk