Forum Moderators: phranque

Message Too Old, No Replies

Why does 403 response only use 13 bytes?

         

aristotle

7:10 pm on May 30, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm wondering why the 403 HTTP Server Response on my websites only uses 13 bytes. For example, here is a Latest Visitor entry for one case:
Host: 85.214.33.71
/
Http Code: 403 Date: May 30 11:28:58 Http Version: HTTP/1.0 Size in Bytes: 13
Referer: -
Agent: -

I have 5 sites on three different servers at two different hosting companies, and all of them only use 13 bytes for a 403 response. I don't have a custom 403 page for any of them, so that's part of the explanation. But if this is compared to a 301 re-direct HTTP response, then there's a big difference. For example, here's an entry for a 301 response which uses 236 bytes.:
Host: 157.55.35.36
/example-page.html
Http Code: 301 Date: May 30 04:49:25 Http Version: HTTP/1.0 Size in Bytes: 236
Referer: -
Agent: Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)

Since they're both HTTP header responses, then why is the 403 response so much smaller than the 301 response. That's what i don't understand. Does anyone have an explnation?

not2easy

8:49 pm on May 30, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Start with the 301 - it is a server response that tells the browser to make another request "over at this URL" so it carries some information, looks like the 236 bytes is the size of the data returned, the new URL.
The 403 is not set up to provide anything except FORBIDDEN! A much shorter message to deliver. It is a good practice to make a 403 page that gives actual humans a way out of this problem, a not-blocked URL where a human could contact you. Yes, a little more bandwidth, but less permanent and less aggravating to a real person.

aristotle

9:11 pm on May 30, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks
You're right -- the 301 has to provide the new URL, so that explains why it's longer.
I may create a 403 page for some sites, although I doubt that many real people are getting blocked with the careful way I do it.

lucy24

9:40 pm on May 30, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What do humans currently see if they blunder onto a 403 (most often by requesting a directory that has no index page)? The server has to send out something; the onscreen 403 message isn't normally generated by the browser. (Unless it's MSIE thinking your 403 page is too small, but that's a different issue.) The Apache default is way more than 13 characters; it's got to be closer to 200.

If you count on your fingers you'll see that only a small part of the 301 header is the actual page title (the redirect target). How many URLs do you have that run longer than 100 characters including the protocol-plus-domain?

aristotle

10:53 pm on May 30, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The Apache default is way more than 13 characters; it's got to be closer to 200.

That's why I started this thread, Lucy. Because I don't understand why it's only 13 bytes either. But that's what the logs show.

And it happens on 5 different websites, on 3 different servers, and two hosting companies.

tangor

11:03 pm on May 30, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'll throw in something more to the head scratching:

On one site my 403 is one of the following:

11bytes
13bytes
177bytes

I do not have a custom 403 on this site. Don't really care what is sent in response to that code... but why the three size returns?

As for the 11 and 13 size I think (just by looking a logs to see what is what) the difference is http 1.0 and http 1.1 . As for the third one, I have no clue as it is an occasional response (size) rather than consistent.

phranque

12:13 am on May 31, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



this is 13 characters, so that may explain the 13:
403 Forbidden


this is only 72 characters, so i'm not sure what else might be in the 301 response (unless it's a really long url...):
301 Moved Permanently
Location: http://www.example.com/example-page.html

aristotle

12:38 am on May 31, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For the case that I showed earlier, a 301 redirect using 236 bytes, the URL is 28 characters, so it's not very long at all.

As for the 403 response, maybe sending a "403 Forbidden" initially is like slamming a door in someone's face, so there's no need to send anything more

lucy24

1:23 am on May 31, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Question stands, though: What do humans (you, for instance) see when they do something that elicits a 403 response?

This may well turn out to be a question about logging levels rather than actual response size.

Wait, I though of another comparison. Say you've got pages that are built around php, possibly including 403/404 responses. Your logs will never show anything but 200, meaning that the request was successfully handed off to the php script. But that doesn't tell you anything about the amount of material that is ultimately sent out to the human user.