Лишние символы перед тегом html, странные цифры в начале и в конце страницы в выдаче веб-сервера

Если выводится странные цифры перед тегом <html> после тега </html> а также внутри самой страницы и вас это пугает, то вот вам решение:

Проблема связана с тем, что некоторые прокси не могут адекватно обрабатывать http 1.1 headerы, которые шлются из php.

Решение — добавить в файл .htaccess строчку:

SetEnv force-no-vary

Объяснение значения отсюда: http://httpd.apache.org/docs/2.2/env.html

force-no-vary

This causes any Vary fields to be removed from the response header before it is sent back to the client. Some clients don’t interpret this field correctly; setting this variable can work around this problem. Setting this variable also implies force-response-1.0.

Можно поробовать еще:

downgrade-1.0

This forces the request to be treated as a HTTP/1.0 request even if it was in a later dialect.

force-response-1.0

This forces an HTTP/1.0 response to clients making an HTTP/1.0 request. It was originally implemented as a result of a problem with AOL’s proxies. Some HTTP/1.0 clients may not behave correctly when given an HTTP/1.1 response, and this can be used to interoperate with them.

Leave a comment

Please be polite and on topic. Your e-mail will never be published.

You must be logged in to post a comment.