Hi,
This is a slightly uncommon case, but I basically have a site where there are dedicated profile sections for each user and the three distinct types of users.
So, each user profile page should be accessed by mysite.com/username but people need to be able to go to a url like mysite.com/moderators to see a list of moderators. Something like mysite.com/moderators/username is also valid, but needs to 301 back to the mysite.com/username format.
So, to recap:
mysite.com/moderators -> users.php?type=mods
mysite.com/moderators/username -> mysite.com/username (301)
What i have is:
RewriteRule ^moderators|admins|users/(.+)$ /$1 [L,R=301]
It is failing in two ways:
- if they go to mysite.com/moderators this rule is triggered - which it shouldn't be since it uses (.+), so if there is no slash followed by one or more characters, it shouldn't match
- if they go to mysite.com/moderators/username - the rule doesn't pass username, and instead redirects to mysite.com/
Thanks in advance for any help in solving this.