httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Donovan <donov...@bellatlantic.net>
Subject Re: [users@httpd] redirect to url w/query_string ???
Date Fri, 20 Jun 2008 16:19:11 GMT
Mike Schleif wrote:
> * Tom Donovan <donovant@bellatlantic.net> [2008:06:20:09:08:55-0400] scribed:
>> 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
...
>>> 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-
> 
> Yes, that is what I want to do.
> 
> However, neither of the following work:
> 
>     RewriteRule  ^/.*$ http://www.Other_domain.tld/?rid=48830 [noescape]
>     RewriteRule  ^/.*$ http://www.Other_domain.tld/?rid=48830 [R=301,NE]
> 
> Does RewriteRule require RewriteCond, or anything else?
> 
> Should RewriteRule work all by itself?
> 
> Is there some way to test WHY this does not work?
> 
> What am I missing?
> 
> 
re: "Does RewriteRule require RewriteCond, or anything else?"	
No, presuming www.Other_domain.tld is on another machine - or at least in a different virtual
host 
so it won't hit the same RewriteRule again after being redirected once.

re: "Should RewriteRule work all by itself?"
Yes.

re: "Is there some way to test WHY this does not work?"
Yes, add this:
    RewriteLog logs/rewrite.log
    RewriteLogLevel 9
then look in logs/rewrite.log for the details of what mod_rewrite is doing.

Works OK for me with Apache 2.2.8 on Windows.  What are you running?

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