Forum Moderators: phranque
(e.g. [mydomain.com...]
rewritten to: (e.g. [mydomain.com...]
How would I do this for all 50 States with one rule?
the only difference in the url is the state abrevation.
Can it be done?
I have been trying for hours but dont have a clue!
Thanks in advance.
RewriteCond $1>de ^delaware>(.+)$ [OR]
RewriteCond $1>md ^maryland>(.+)$ [OR]
RewriteCond $1>ny ^new-york>(.+)$ [OR]
RewriteCond $1>pa ^pennsylvania>(.+)$ [OR]
RewriteCond $1>va ^virginia>(.+)$ [OR]
...
RewriteCond $1>wy ^wyoming>(.+)$
RewriteRule ^inspectors/([^.]+)\.html$ /inspectors/inspectors.php?st=%1 [L]
The ">" character doesn't really do anything, except to visually-delimit the two variables in each RewriteCond. I use it because it implies concatenation, but it is not treated as an operator by the regular-expressions parser.
Note that there must not be an [OR] flag on the final RewriteCond.
Jim