Compare these two RedirectMatch
's. The first doesn't work:
RedirectMatch 302 ^/redirect\.php[?]page=(.+)$ http://somewhereelse.com/$1
Versus this, which will redirect to http://somewhereelse.com/?page=wherever
:
RedirectMatch 302 ^/redirect\.php([?]page=.+)?$ http://somewhereelse.com/$1
Does RedirectMatch
only match the URI and not the query string? Apache's documentation is a bit vague in this area. What I'm trying to do is extract the page
query parameter and redirect to another site using it.
Is that possible with RedirectMatch
or do I have to use RewriteCond
+ RewriteRule
?