I have this dynamic rule:
RewriteRule ^(.*)/(.*)$ /rewrite.php?sub=$1&second=$2 [NC]
and I am trying to add some static rules like this:
RedirectMatch 302 /construction/pools.html http://www.{samedomain}.com/construction-services/pools
The problem is when I type the following in the address bar:
http://www.{samedomain}.com/construction/pools.html
then apache redirects to:
http://www.{samedomain}.com/construction-services/pools?sub=construction&second=pools.html
What I want is apache redirects to:
http://www.{samedomain}.com/construction-services/pools
Does anybody know why?
Thank you.
Redirects are processed in the order they appear, so it should work to place the static redirect before the
RewriteRule. Don’t for get the[L]flag on yourRewriteRule.Or you could do it without the
RewriteCondif none of your dynamic urls have a.