[SATLUG] Regexp help

twistedpickles twistedpickles at gmail.com
Mon Sep 15 17:36:04 CDT 2008


Working on mod rewrite regexp and I'm at a road block.

My url's look like this: www.website.com/2/index.php?artist=billy%20bob

With rewrite they now look like this: www.website.com/2/artist/billy_bob

But last minute I decided I want them to look like this:
www.website.com/2/artist/billy-bob

I can't change my mod rewrite rule to exclude the "_" because the URLs have
already been embedded in my enhanced podcast.

My actual regexp:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^2/artist/([A-Za-z0-9._]*[A-Za-z0-9-._]*)$
/2/index.php?artist=$1 [NC]

I'm not sure where to stick the "-" to make it work. I've tried before the
"." and after the "_" without success.

Thanks for your help.







::twistedPickles:: :


More information about the SATLUG mailing list