G
G
Genome_X2012-03-18 16:38:12
Apache HTTP Server
Genome_X, 2012-03-18 16:38:12

Apache's weird handling of .htaccess

Good day!
I ran into a strange problem, there is an Apache server version 2.2.22, a 32-bit version, there is a system where it all spins - Win 7 64-bit.

The server installed, correctly configured httpd.conf, set the AllowOverride directive for the htdocs folder to All
Created a .htaccess file, where I registered an error handler, for example: ErrorDocument 404 /err/404.html
I type in the browser something like localhost / sdaqfafs (i.e., a page that obviously does not exist and I encounter the fact that the browser (IE9) returns not the 404.html page I created, but its own (i.e., as if my page 404 .html was not there at all). miracle!- my 404.html is issued, but for some reason, when reloading the same page again, it disappears again and the standard browser window is displayed again.
What could be funny? I double-checked the paths ten times, and even if they were crooked, the page would never have been displayed at all, but for some reason, as a result of shamanism, it is still displayed once.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Belugin, 2012-03-18
@Genome_X

Internet Explorer has a lightly-documented “feature” that stops it from serving any custom 404 error page that is less than 512 bytes long. Your visitors will instead be sent to IE's own 404 page (screenshot), which is generic and suggests they use an MSN search to “look for information on the Internet.” That's one way to lose visitors! Make sure your custom 404 error page is over this limit - about 10 full lines of text and HTML should be enough.

It looks like the page size needs to be larger than 512 bytes.

G
Genome_X, 2012-03-18
@Genome_X

PPC, it seems to be true, I added text, links and other things and everything began to work. One file, of course, is still less than 512 bytes, but it still began to be displayed correctly.
Kapets, now I seem to understand why web developers do not like IE so much, I started to study development, I use IE9 as a browser, and this is the second cant that all other browsers process correctly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question