Forum Moderators: phranque

Message Too Old, No Replies

Headers Returned

do these seem proper

         

phish

7:10 am on Mar 4, 2006 (gmt 0)

10+ Year Member



Here's my situation..
I have an Apache server, it is automatically setup to redirect non-www to www in httpd.conf. The default mod-rewrite from Apache in the configuration file is [R] which always returned the obvious 302, so I changed it to [R=301]. My question is when I query www.domain.com on http1.0 protocol it shows the 301 redirecting to www.domain.com, in other words to itself. http1.1 gives the correct 200 ok. I know http1.0 can't read headers, but should it show a 301 or 200? I'm assuming a 200.
here is my redirect code

RewriteEngine on
RewriteCond %{HTTP_HOST}!^000.000.000.000(:80)?$
RewriteCond %{HTTP_HOST}!^www.domain.com(:80)?$
RewriteRule ^/(.*) [domain.com...] [L,R=301]
RewriteOptions inherit

would the following fix the issue assuming it would check for the host, and if http1.0 then give a 200?

RewriteCond %{HTTP_HOST} .

-phish

jdMorgan

4:04 pm on Mar 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, HTTP/1.0 clients do not send a host header to your server, therefore your server will redirect, because the variable is blank and won't match your specified hostname or IP address.

Adding the blank-check RewriteCond will fix it.

Jim