Re: Avoid endless loop of mod_rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 8, 2010 at 10:47 AM, Michael Menegakis <arxeio@xxxxxxxxx> wrote:
Hi all

A rule is in place that that rewrites domains to www.domains

In one particular home dir, I need the opposite,

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

But it goes into an endless loop that eventually makes firefox spit

'The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for
this address in a way that will never complete.'

How to ignore the higher level rule?

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


RewriteRules have never been a success for me in redirecting domain to www.domain

I use this config inside a virtualhost for domain.

I.e. I have a virtualhost whose ServerName is set to domain.com

and only one line inside that -

RedirectPermanent / http://www.domain.com/

If you have SSL on your domain, this going to create some problems.

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux