Help with RewriteRule syntax

Topics: User Forum
Coordinator
Aug 28, 2006 at 4:33 PM
User writes:
how to convert ...
/cf/featured_builder.cfm?dest=http://www.wbc.com&title=WBC%20Builders
to ...
/cf/WBC-Builders


Try this:

  1. translate %20 to dashes
RewriteRule ^/cf/featured_builder.cfm\?dest=http://www.wbc.com&title=(^\&)\%20(^\&)$ /cf/$1-$2 L

  1. handle the case with no %20
RewriteRule ^/cf/featured_builder.cfm\?dest=http://www.wbc.com&title=(^\&+)$ /cf/$1 L

you should read up on regular expressions, and check out the testdriver.exe program, which will let you test your rules without running in the server. see the readme for more info.