I got this from the URL I mentioned in a previous post. I have modified
it a bit to what looks like a solution. I guessing that the condition
are met w/ no Host: header or a Host: cloudstock.com header. It looks
like it would solve the no Host: header problem as well as do my primary
task of sending everyone to www.cloudstock.com. Can someone w/
mod_rewrite experience tell me if it suffices?
Boy, this thread has gotten REALLY off topic. I apologize to the list
for that, but I do appreciate all the posts. :-)
RewriteCond %{HTTP_HOST} !^domain\.name [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://www.domain.name/$1 [L,R]
Jim Winstead wrote:
>
> On Apr 07, Randal L. Schwartz wrote:
> > I think this also suffers from placing the burden on the client. The
> > [R] there with an external rewrite means that the client will get
> > redirected if it doesn't tell you the right "Host:" header. But
> > HTTP/1.0 and older browsers (and some spiders) will NOT tell you that
> > header, so you get in an infinite loop.
> >
> > The solution is that you must allow for an unspoken "Host:" header to
> > fall through to a generic v-host.
>
> An important point is that although "Host:" wasn't required until
> HTTP/1.1, all of the common browsers have sent it with 1.0 requests
> for some time. This includes Netscape since version 2.0 and Internet
> Explorer since 3.0. Most browsers released since 1996 have sent
> it. I strongly suspect that all of the reputable search engine
> spiders send it as well.
>
> (That doesn't mean you shouldn't be careful and structure it so
> that you don't send Host-less requests into a redirect loop, I just
> want to make sure people know the situation isn't quite as dire as
> Randal may have made it sound. There are a large number of people
> relying on browsers sending the Host header to great effect.)
--
Drew Taylor
Vialogix Communications, Inc.
501 N. College Street
Charlotte, NC 28202
704.370.0550
http://www.vialogix.com