This is a discussion on Rewriterule does not work when URL contains '?' within the Apache Web Server forums, part of the Web Server and Related Forums category; I would like to create a 301 redirect as follow: RewriteRule abc.php?variable=xxx http://www.domain.com/abc....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I would like to create a 301 redirect as follow:
RewriteRule abc.php?variable=xxx http://www.domain.com/abc.php [R=301] It only work when I remove the '?' |
|
|||
|
earnpin@gmail.com wrote:
> I would like to create a 301 redirect as follow: > > RewriteRule abc.php?variable=xxx http://www.domain.com/abc.php [R=301] > > It only work when I remove the '?' You cannot access the QueryString within the RewriteRule, you must use a RewriteCondition. So the QueryString should be removed? Rewritecond %{QUERY_STRING} ^variable=xxx$ RewriteRule ^abc\.php$ http://www.domain.com/abc.php? [R=301,L] -- Robert |