Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular Expressions Help

Status
Not open for further replies.

ralphiooo

Programmer
Oct 23, 2005
64
GB
Hi, i have a band directory on my site and i want to be able to put /bandname/ in the url and it will work instead of going /bands/bandname/. I have created a rewrite with the following:

RewriteRule ^(^forum|gallery|images|labels|news)/?$ /bands/$1/index.php [NC,QSA]

What i'm trying to say is if the directory not (forum or gallery or images or labels or news) then it must be a band therefore redirect to the bands page but it does not work.

Appreciate if someone could show me what i've done wrong. Cheers
 
i have not tested this but i think you are using the wrong negation
Code:
RewriteRule ^(![forum|gallery|images|labels|news])/?$ /bands/$1/index.php [NC,QSA]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top