homepage Welcome to WebmasterWorld Guest from 54.197.215.146
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
rewrite only partially working
Dirk_php




msg:4530262
 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

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved