Forum Moderators: phranque

Message Too Old, No Replies

Gettin plain/text page including headers instead of html

         

oberststen

10:02 pm on Oct 22, 2007 (gmt 0)

10+ Year Member



Hello, I have this problem: very randomly when I'm browsing in my site I get a plain-text page including headers, I'm using Firefox, if I go to the Page info it says "Respone: http/0.9 200 OK", I've been for months trying to fix it without any success, as you can see in the image I'm posting, there is a "tab" character before the HTTP/1.1

And as I said the site works fine almost every time, but sometimes that happen, and now I really don't know what to do.

<snip>

Thanks, Jaime

[edited by: jdMorgan at 10:13 pm (utc) on Oct. 22, 2007]
[edit reason] screenshot contains domain name, please see TOS. [/edit]

jdMorgan

10:18 pm on Oct 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This indicates that the server is returning a corrupted HTTP response header, and that Firefox is treating "<tab>HTTP/1.1" as if it were "HTTP/0.9".

So the next question is, have you asked your host about this? It seems to be an Apache configuration or installation problem. Alternatively, if you are overwriting or generating some of the HTTP response codes in .htaccess or with a script, then you might want to look into that code to find the error.

If this is a server problem and you can't get help from the host, consider switching hosts.

Jim

oberststen

2:16 am on Oct 23, 2007 (gmt 0)

10+ Year Member



this is my .htaccess

Options -Indexes
ErrorDocument 403 http://www.example.com/error/?code=403
ErrorDocument 404 http://www.example.com/error/?code=404
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.example.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.example.com$ [NC]
RewriteRule .*\.(gif在mp存wf她sf妃p3)$ http://www.example.com/images/h/1.gif [L,R,NC]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

and I'm not modifying anything of the header in any of my .php, I already sent an e-mail to my hosting, and they say they will be monitoring my account to see what's happening

[edited by: jdMorgan at 2:23 am (utc) on Oct. 23, 2007]
[edit reason] No domain names, please. See Terms of Service. [/edit]

jdMorgan

2:44 am on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are several serious errors in your .htaccess file, and several inefficiencies as well. Since we can't help with your main problem until your host investigates, we might as well fix your .htaccess code.

Unfortunately, none of this is going to affect your main problem.

Options -Indexes
ErrorDocument 403 /error/?code=403
ErrorDocument 404 /error/?code=404
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://www\.example\.com
RewriteCond %{REQUEST_URI} !^/images/h/1.gif
RewriteRule \.(gif在mp存wf她sf妃p3)$ http://www.example.com/images/h/1.gif [NC,R=302,L]
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Do not use a full URL in ErrorDocument directives. Doing so will result in the client receiving a 302-Found redirect, instead of the correct error code. This can seriously affect your search engine ranking results by confusing search engine spiders.
See the ErrorDocument documentation for details. You can check this using any one of a number of on-line server header checkers, or with the "Live HTTP Headers" extension for Firefox and Mozilla browsers (I recommend this extension for any serious server work).

Escape all literal periods in regex patterns with a preceding "\".
Do not end-anchor the domain name in RewriteCond patterns. Or if you feel you must end-anchor it, then make provisions for an optional trailing port number. Example pattern: ^www\.example\.com(:[0-9]+)?$

Using "." instead of "!^$" is equivalent, but shorter and faster.
By leaving the end-anchor off the domain name in the second RewriteCond pattern of the second rule, you can cover all possible variations of trailing path info using only that one RewriteCond.
Adding a RewriteCond to prevent redirection of /images/h/1.gif will prevent an 'infinite' redirection loop.

A pattern of "\.gif$" is entirely equivalent to a pattern of ".*\.gif$" if neither are start-anchored using "^".

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim

oberststen

3:43 am on Oct 23, 2007 (gmt 0)

10+ Year Member



Thank you very much, I updated my .htaccess file.

And for my problem, what you think I should say to my host that is causing the problem, or what can I do from my part?

Thanks, Jaime

jdMorgan

12:46 pm on Oct 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The first thing to do is to get rid of that tab character in the server response header, as that is clearly wrong.

Jim

oberststen

6:40 pm on Oct 27, 2007 (gmt 0)

10+ Year Member



So finally they changed me to another server, they said that error was because of the server load, and now in this new one I'm not having the error, so hopefully it will continue like that.

Thank you very much for your help. Jaime.