Java Mailing List Archive

http://www.apache-httpd.com/

Home » users.httpd »

Re: [users@httpd] redirect to url w/query_string ???

Tom Donovan

2008-06-20

Replies: Find Java Web Hosting

Author LoginPost Reply
Mike Schleif wrote:
> I want the URL's similar to the following:
>
>   http://domain.tld
>   http://www.domain.tld
>   http://domain.tld/
>   http://domain.tld/fjlxasdfja
>
> to be redirected to the following URL:
>
>   http://Other_domain.tld/?rid=48830
>
>
> I have tried -- and failed -- with following:
>
>   RedirectMatch ^/$ http://Other_domain.tld/?rid=48830
>
>   RewriteCond  %{QUERY_STRING} ^(rid=48830)$
>   RewriteRule  ^/$ http://www.Other_domain.tld/$1?
>
>
> NOTE[1]: There is NO query_string in original URL.
>
> NOTE[2]: I have NOT found a way to escape the "?" in the destination
> URL.
>
> NOTE[3]: The result is always either "?" replaced with "%" escapes; or,
> NO query_string at all.
>
>
> What am I missing?
>

It's not clear what you are trying to do.

  Other_domain.tld   vs.  www.Other_domain.tld
  /             vs.  all URIs

If you want everything re-directed to http://www.Other_domain.tld, try using just this single
rewrite rule with the [noescape] flag:

  RewriteRule  ^/.*$ http://www.Other_domain.tld/?rid=48830 [noescape]

-tom-

---------------------------------------------------------------------
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@(protected)
 "  from the digest: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.