亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

目錄 搜尋
Guides Access control CORS Authentication Browser detection using the user agent Caching Caching FAQ Compression Conditional requests Connection management in HTTP 1.x Content negotiation Content negotiation: List of default Accept values Cookies CSP Messages Overview Protocol upgrade mechanism Proxy servers and tunneling Proxy servers and tunneling: Proxy Auto-Configuration (PAC) file Public Key Pinning Range requests Redirections Resources and specifications Resources and URIs Response codes Server-Side Access Control Session Guides: Basics Basics of HTTP Choosing between www and non-www URLs Data URIs Evolution of HTTP Identifying resources on the Web MIME Types MIME types: Complete list of MIME types CSP Content-Security-Policy Content-Security-Policy-Report-Only CSP: base-uri CSP: block-all-mixed-content CSP: child-src CSP: connect-src CSP: default-src CSP: font-src CSP: form-action CSP: frame-ancestors CSP: frame-src CSP: img-src CSP: manifest-src CSP: media-src CSP: object-src CSP: plugin-types CSP: referrer CSP: report-uri CSP: require-sri-for CSP: sandbox CSP: script-src CSP: style-src CSP: upgrade-insecure-requests CSP: worker-src Headers Accept Accept-Charset Accept-Encoding Accept-Language Accept-Ranges Access-Control-Allow-Credentials Access-Control-Allow-Headers Access-Control-Allow-Methods Access-Control-Allow-Origin Access-Control-Expose-Headers Access-Control-Max-Age Access-Control-Request-Headers Access-Control-Request-Method Age Allow Authorization Cache-Control Connection Content-Disposition Content-Encoding Content-Language Content-Length Content-Location Content-Range Content-Type Cookie Cookie2 Date DNT ETag Expect Expires Forwarded From Headers Host If-Match If-Modified-Since If-None-Match If-Range If-Unmodified-Since Keep-Alive Large-Allocation Last-Modified Location Origin Pragma Proxy-Authenticate Proxy-Authorization Public-Key-Pins Public-Key-Pins-Report-Only Range Referer Referrer-Policy Retry-After Server Set-Cookie Set-Cookie2 SourceMap Strict-Transport-Security TE Tk Trailer Transfer-Encoding Upgrade-Insecure-Requests User-Agent User-Agent: Firefox Vary Via Warning WWW-Authenticate X-Content-Type-Options X-DNS-Prefetch-Control X-Forwarded-For X-Forwarded-Host X-Forwarded-Proto X-Frame-Options X-XSS-Protection Methods CONNECT DELETE GET HEAD Methods OPTIONS PATCH POST PUT Status 100 Continue 101 Switching Protocols 200 OK 201 Created 202 Accepted 203 Non-Authoritative Information 204 No Content 205 Reset Content 206 Partial Content 300 Multiple Choices 301 Moved Permanently 302 Found 303 See Other 304 Not Modified 307 Temporary Redirect 308 Permanent Redirect 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 407 Proxy Authentication Required 408 Request Timeout 409 Conflict 410 Gone 411 Length Required 412 Precondition Failed 413 Payload Too Large 414 URI Too Long 415 Unsupported Media Type 416 Range Not Satisfiable 417 Expectation Failed 426 Upgrade Required 428 Precondition Required 429 Too Many Requests 431 Request Header Fields Too Large 451 Unavailable For Legal Reasons 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout 505 HTTP Version Not Supported 511 Network Authentication Required Status
文字

網(wǎng)站所有者反復(fù)提出的問題是,是否選擇非 www 或 www 網(wǎng)址。本頁面提供了一些有關(guān)最好的建議。

什么是域名?

In an HTTP URL, the first substring that follows the initial http:// or https:// is called the domain. It is the name of the server where the document resides.

服務(wù)器不一定是物理機(jī)器:幾臺服務(wù)器可以駐留在同一臺物理機(jī)器上?;蛘撸慌_服務(wù)器可以由多臺機(jī)器處理,合作產(chǎn)生答案或平衡它們之間的請求負(fù)載。關(guān)鍵是,一個域名在語義上代表一臺服務(wù)器。

那么,我必須為我的網(wǎng)站選擇一個還是另一個?

  • 是的,你需要選擇一個并堅持下去。選擇哪一個作為您的規(guī)范位置是您的選擇,但是如果您選擇一個,請堅持使用它。它會讓你的網(wǎng)站對用戶和搜索引擎更加一致。這包括始終鏈接到所選域名(如果您在網(wǎng)站中使用相對 URL,這應(yīng)該不難),并始終將鏈接(通過電子郵件/社交網(wǎng)絡(luò)等)共享到同一個域名。

  • 不,你可以有兩個。重要的是你是一致的,并與哪一個是官方域名一致。這個官方域名稱為 規(guī)范 名稱。你所有的絕對鏈接都應(yīng)該使用它。但即便如此,您仍然可以使其他域名正常工作:HTTP 允許使用兩種技術(shù),以便您的用戶或搜索引擎明確哪些域是規(guī)范域,同時仍允許非規(guī)范域工作并提供預(yù)期頁面。

因此,請選擇一個您的域名作為您的域名!下面有兩種技術(shù)可以讓非規(guī)范域繼續(xù)工作。

規(guī)范 URL 的技巧

有不同的方法可以選擇哪個網(wǎng)站是規(guī)范的。

使用 HTTP 301重定向

在這種情況下,您需要配置接收 HTTP 請求的服務(wù)器(對于www和非www URL,這很可能是相同的),以響應(yīng)301對非規(guī)范域的任何請求的足夠 HTTP 響應(yīng)。這會將嘗試訪問非規(guī)范 URL 的瀏覽器重定向到其規(guī)范等效項。例如,如果您選擇使用非www網(wǎng)址作為規(guī)范類型,則應(yīng)將所有 www 網(wǎng)址重定向到其沒有 www 的等效URL。

示例:

1. 服務(wù)器收到請求http://www.example.org/whaddup(當(dāng)規(guī)范域是 example.org時)

2. 服務(wù)器301使用包含Location標(biāo)題的代碼進(jìn)行回答: http://example.org/whaddup。

3. 客戶端向規(guī)范域發(fā)出請求: http://example.org/whatddup

HTML5樣板項目有一個例子如何配置Apache服務(wù)器重定向到一個域到另一個。

運(yùn)用 <link rel="canonical">

可以在頁面中添加一個特殊的 HTML <link>元素來指示頁面的規(guī)范地址是什么。這對頁面的人類讀者沒有任何影響,但會告知搜索引擎搜尋器頁面實際所在的位置。這樣,搜索引擎就不會多次索引同一頁面,有可能導(dǎo)致它被視為重復(fù)的內(nèi)容或垃圾郵件,甚至從搜索引擎結(jié)果頁中刪除或降低您的頁面。

當(dāng)添加這樣的標(biāo)簽時,您為兩個域提供相同的內(nèi)容,告訴搜索引擎哪些 URL 是規(guī)范的。在前面的例子中,http://www.example.org/whaddup會提供相同的內(nèi)容http://example.org/whaddup,但<link>在頭部還有一個額外的元素:

<link href="http://example.org/whaddup" rel="canonical">

與以前的情況不同,瀏覽器歷史記錄會將非www和www的 URL 視為獨(dú)立條目。

讓您的網(wǎng)頁適用于兩者

利用這些技術(shù),您可以配置服務(wù)器以正確響應(yīng)www前綴和非www前綴域。這樣做是一個很好的建議,因為您無法預(yù)測哪些 URL 用戶將在瀏覽器的 URL 欄中輸入內(nèi)容。選擇哪種類型作為規(guī)范位置,然后將其他類型重定向到它是一個問題。

決定的案件

這是一個非常主觀的話題,它可以被認(rèn)為是一個自相矛盾的問題。

上一篇: 下一篇: