httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg" <g...@textor.com>
Subject RE: AW: [users@httpd] Redirection trick with querystrings
Date Fri, 09 Jan 2004 13:25:16 GMT



OK, solved! For the record (archives), the lines that worked were:

RewriteCond %{QUERY_STRING} ^(.+)$
RewriteRule redir\.pl http://myserver.com/%1?

The last '?' is to block the 'original' querystring from appending at the
back of the URL. We make it part of the 'main' URL with the %1 bit.

Thanks for the pointer Joshua.

Regards,
Greg




> -----Original Message-----
> From: Joshua Slive [mailto:joshua@slive.ca]
> Sent: 08 January 2004 13:26
> To: users@httpd.apache.org
> Subject: Re: AW: [users@httpd] Redirection trick with querystrings
>
>
>
> On Thu, 8 Jan 2004, SH Solutions wrote:
>
> > Hi
> >
> > > For example, when I use
> > > RewriteRule redir\.pl?(.*) http://myserver.com/$1
> > > I get
> > > http://myserver.com/?g/index.htm
> >
> > The ? is interpreted as part of the reg exp. Try
> >
> > > RewriteRule redir\.pl\?(.*) http://myserver.com/$1
>
> No.  Neither RewriteRule nor RedirectMatch will match against the query
> string, you need something like
>
> RewriteCond %{QUERY_STRING} ^(.*)$
> RewriteRule ^/redir\.pl /%1
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message