Rewriterule does not work when URL contains '?'

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....


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-01-2006
earnpin@gmail.com
 
Posts: n/a
Default Rewriterule does not work when URL contains '?'

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 '?'

  #2 (permalink)  
Old 01-01-2006
Robert Ionescu
 
Posts: n/a
Default Re: Rewriterule does not work when URL contains '?'

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:34 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0