166

As you correctly note, the Accept header is used by HTTP clients to tell the server what content types they'll accept. The server will then send back a response, which will include a Content-Type header telling the client what the content type of the returned content actually is. However, as you may have noticed, HTTP requests can also contain Content-Type ...


24

Accept: is what the browser is able to digest, for example, all the languages someone can understand. Content-Type: is what format the actual data is in, for example what language someone is speaking. Since computers can't (well, now they can) recognize other types like people can say "oh, he's German!" or "she's speaking Chinese!"


23

Accept is like Here is my request and I would like (to Accept) this response format Content-Type is like Here is my request (or response) and this (Content-Type) is the format of the content I am sending in my request (or response)


17

Change your htaccess file code on your website root directory (i.e. Your public_html ".htaccess" file) <FilesMatch "\.(ttf|otf|eot|woff|woff2)$"> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "http://skin.cdn.com" </IfModule> </FilesMatch> Now your CDN will be allowed to load your resource calling ...


16

It might come from 60 * 60 * 24 * 7 * 4 * 12 = 29030400 where each month consists of exactly 4 weeks.


15

According to the current version of the HTTP/1.1 standard, RFC 2616, the value of the Location header must be an absolute URI. However, in the draft standard prepared by the HTTPbis Working Group to eventually replace RFC 2616, this has been changed to allow relative URIs as well, apparently because: "The definition of the Location header [in RFC 2616] ...


12

In client-server applications, the IP address of the client (i.e., the browser) is sent via the socket connection (the request) to the server (e.g., Apache). If the client is using a proxy server however, that may be the proxy's IP address instead of the client's IP. Remote_Addr is an ENV returned by the server and available to server-side scripts/...


12

Unfortunately, you can't. Google search now exclusively uses HTTPS and all search result clicks go through an intermediate URL that removes the keywords. The URL you posted above appears to be that intermediate URL, and that's all you get as the referrer. The reasoning behind this is that each user of Google often gets personalised results based on their ...


11

It's correct to set this directive like RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS} If it doesn't work, you may need to install and enable the module mod_headers.


9

If you use the "Fetch as Google" tool in Google Search Console on a page that returns a "418 I'm a Teapot" status then it simply reports an "Error" and indexing cannot be requested for this page. In the screenshot below, the circled "Error"s are the result of requesting a page that returns a 418 status. No further information is available at this stage. ...


8

If the page is not replaced by new content Send a 410 GONE HTTP status message which tells search engines that the page doesn't exist anymore. Have the page's content tell the user why the page is gone and give them options for finding existing content on your website. This should links to your home page, site map (if one exists), search page (if one exists),...


8

It is a request-response conversation, so the client sends a request of "Content-Type" and expects to receive the response of "Accept" media type.


7

Yes. By the HTTP protocol, clause 7.2.1: “Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI ...


7

I have decided to serve only gzipped version of my pages If you're only serving files that you've compressed using gzip, then using Vary: Accept-Encoding will be of no benefit since there won't be uncompressed copies of the files to serve to clients that don't send Accept-Encoding: gzip in the HTTP request. Most clients these days do send this, so you ...


6

"Is there a common way to override the server headers send to the browser from within the HTML document?" AFAIK no, you do what you can do already. The defined charset via Header trumps your definition in the META tag. If you have access to the server, e.g. Apache, it is configured by this statement (see the comment lines): # Read the documentation before ...


6

Section 14.30 of the HTTP 1.1 RFC http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30 is not significantly different. I don't know that you're going to see any actual practical limitations for this. The only time I've seen even a warning about this issue is when I used to test in Lynx and the location was not absolute it would warn you "Location ...


6

This isn't so much an SEO issue, as an issue as to whether your site would work at all. If it doesn't work in the browser then it's certainly going to hurt your SEO. Your HTML pages still need to return the text/html mime-type in order to be interpreted as HTML by the browser. ie. You need to send a Content-Type: text/html HTTP response header somehow. ...


5

John Conde's suggestion of returning an HTTP 410 Gone status code is good, but, depending on the circumstances, a plain old HTTP 404 Not Found might be more appropriate. Specifically, the HTTP 410 status code is intended to signal that the resource has been deliberately and permanently deleted, is not expected to return, and that links to it should be ...


5

What you want is the immutable keyword in your Cache-Control line. Example for php: header('Cache-Control: public, max-age=80000, immutable'); Source: https://code.facebook.com/posts/557147474482256/this-browser-tweak-saved-60-of-requests-to-facebook/


5

The s-maxage header is intended for proxies, while max-age is intended for regular users. A typical end user (not using a proxy) would have the file cached for a year. The same should be the case for someone using a proxy as well, since the proxy will likely send the file unmodified, i.e. including the max-age header. But the proxy itself would only cache ...


5

Some search engines and bots send HEAD request to pages before sending the GET request for reasons like: Checking if the page size has changed Checking the last modified date etc. (Any other info the head would give them!) This would help large crawlers save a lot of bandwidth if they know a page has not been changed meanwhile and they don't have to crawl ...


5

The reason is that your directive in the X-Robots-Tag is for indexation, not crawling. [EDIT] Explicit reference to this point is made here: https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag This document details how Google handles the page-level indexing settings allow you to control how Google makes content available ...


5

Google considers redirecting content that is no longer available to be "soft 404". They would like to be able to treat the page the same as a 404 page. If you redirect the expired page to your home page, Google will identify it as a soft 404. It will appear in Google Webmaster Tools as an error. Google won't pass the link juice from inbound links to ...


5

Well aren't you friendly... "Hey Google, I'm having a DOS, but im making it your problem, thanks" First: There is no difference for you between serving an 301 or an 404 error page. Your server will have to do the same amount of work. The difference here is that you, with your 301->google solution, now ALSO make it Google's problem, effectively ...


4

From my understanding and experience it seems to me perhaps you've misunderstood how CDN caching works: From the example you've given, the CDN would not ask your web-server when the file was last modified because you've already told it that the file has expired and will therefore need to be re-fetched anyway. Web browsers will only send an If-Modified-Since ...


4

http://www.example.com/ and http://www.example.com are the same URL. Whether or not the trailing slash is shown in the browser address bar is purely cosmetic - when the request is sent to the server the slash will be included. (http://www.example.com/foo and http://www.example.com/foo/ on the other hand are different URLs.) If the site you're working on is ...


4

how this workaround indeed works PHP runs later in the request, so most of the time you can simply override any headers that Apache has already set in your PHP code. That's pretty much it. (Aside: Sending 403s through your 404 handler in this way obviously makes it harder to trigger a real 403 from your Apache config/.htaccess, if you should need to.) ...


3

The problem is you have a hidden character between the <head> and first <meta> element. Make sure all your pages and PHP files have the correct UTF-8 encoding (you can convert them in Notepad++ or Sublime Text if you have those apps). Edit: just tested and it's the character 'ZERO WIDTH NO-BREAK SPACE' (U+FEFF)


3

No, it's not possible from within the HTML. The servers response header take precedence over the document's meta-tag. As it's specified in 5.2.2 Specifying the character encoding - HTML 4.01 Specification : To sum up, conforming user agents must observe the following priorities when determining a document's character encoding (from highest priority to ...


3

You should set something like this in your root .htaccess <FilesMatch "\.(htm|html|xhtml|xml|php)$"> AddDefaultCharset utf-8 </FilesMatch>


Only top voted, non community-wiki answers of a minimum length are eligible