rewrite help again please :)

Claude Bing tehbing at gmail.com
Thu May 14 20:39:46 MSD 2009


Firefox says: REDIRECT LOOP  Firefox has detected that the server is
redirecting the request for this address in a way that will never complete.

lol.

It's only when I use www.wfto.cc, and not wfto.cc.

Figured it out while writing this e-mail.  Make sure that when you use those
rewrite rules that you actually have a server named www.whatever.com, or it
will end up in a redirect loop.

Thanks again,

Claude

On Thu, May 14, 2009 at 6:12 PM, Claude Bing <tehbing at gmail.com> wrote:

> Thank you very much, will try to get this working now.
>
> 2009/5/14 Denis F. Latypoff <denis at gostats.ru>
>
> Hello Igor,
>>
>> Thursday, May 14, 2009, 9:56:19 PM, you wrote:
>>
>> > On Thu, May 14, 2009 at 09:38:49PM +0700, Denis F. Latypoff wrote:
>>
>> >> Hello Claude,
>> >>
>> >> Thursday, May 14, 2009, 9:23:55 PM, you wrote:
>> >>
>> >> > Hello!  I have a question.
>> >>
>> >> > I'm trying to set up Nginx to forward my old domain to my new domain.
>> >> > waterfortheoppressed.com => wfto.cc.   But I not only need it to
>> forward it,
>> >> > I need the persons browser address to change to wfto.cc.  I'll
>> provide the
>> >> > working Apache example here:
>> >>
>> >> >    RewriteEngine On
>> >> >    RewriteCond %{HTTP_HOST} ^(waterfortheoppressed.com) [NC]
>> >> >    RewriteRule ^(.*)$ http://www.wfto.cc$1 [R=301,L]
>> >>
>> >> >    RewriteCond %{HTTP_HOST} ^(www.waterfortheoppressed.com) [NC]
>> >> >    RewriteRule ^(.*)$ http://www.wfto.cc$1 [R=301,L]
>> >>
>> >> > Thanks for any help you may have.
>> >>
>> >> server {
>> >>        listen 80;
>> >>        server_name www.waterfortheoppressed.com
>> >>                        waterfortheoppressed.com;
>> >>        # staff
>> >> }
>> >>
>> >> server {
>> >>        listen 80;
>> >>        server_name _;
>> >>
>> >>        location / {
>> >>               rewrite ^ http://www.wfto.cc$request_uri? permanent;
>> >>        }
>> >> }
>>
>> > Vice versa:
>>
>> >  server {
>> >         listen 80;
>> >         server_name www.waterfortheoppressed.com
>> >                         waterfortheoppressed.com;
>>
>> >         rewrite ^ http://www.wfto.cc$request_uri? permanent;
>> >  }
>> >
>> >  server {
>> >         listen 80;
>> >         server_name www.wfto.cc;
>>
>> >         # staff
>> >  }
>>
>> That was additional homework for Claude :)
>>
>> --
>> Best regards,
>>  Denis                            mailto:denis at gostats.ru
>>
>>
>>
>
>
> --
>
> Vince Lombardi<http://www.brainyquote.com/quotes/authors/v/vince_lombardi.html> - "We didn't lose the game; we just ran out of time."




-- 

Don Marquis <http://www.brainyquote.com/quotes/authors/d/don_marquis.html>
- "Procrastination is the art of keeping up with yesterday."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090514/1675f3b4/attachment.html>


More information about the nginx mailing list