日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php 跨区域,如何构造PHP的内容包括在非安全(http://)和安全(https://)区域以及跨多个目录使用?...

發布時間:2023/12/9 php 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php 跨区域,如何构造PHP的内容包括在非安全(http://)和安全(https://)区域以及跨多个目录使用?... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

只需使用//example.com/foo.blah即可.

< img id =“sample-image”src =“// /media/sample-image.png”/>

很明顯,HTTP是協議,但存在其他協議,如GOPHER,HTTPS,FTP等……

而不是在gopher URL gopher://example.com上,您只需鏈接到//example.com,協議就可以在沒有它的情況下工作.如果要從HTTPS鏈接到HTTP內容,則應指定協議.

從長遠來看,這可能是有趣的,例如,如果另一個協議出現與HTTP幾乎相同的工作(例如,谷歌試圖制作spdy://),您將不得不更新所有代碼.當您特別需要從該協議獲取內容時使用特定協議,您可能會在未來5年內避免此問題.

RFC for URL,RFC3986中描述了相對URL:

4.2. Relative Reference

A relative reference takes advantage of the hierarchical syntax

(Section 1.2.3) to express a URI reference relative to the name space

of another hierarchical URI.

relative-ref = relative-part [ "?" query ] [ "#" fragment ]

relative-part = "//" authority path-abempty

/ path-absolute

/ path-noscheme

/ path-empty

The URI referred to by a relative reference, also known as the target

URI, is obtained by applying the reference resolution algorithm of

Section 5.

A relative reference that begins with two slash characters is termed

a network-path reference; such references are rarely used. A

relative reference that begins with a single slash character is

termed an absolute-path reference. A relative reference that does

not begin with a slash character is termed a relative-path reference.

A path segment that contains a colon character (e.g., “this:that”)

cannot be used as the first segment of a relative-path reference, as

it would be mistaken for a scheme name. Such a segment must be

preceded by a dot-segment (e.g., “./this:that”) to make a relative-

path reference.

要了解“路徑”,“權限”和“方案”的含義,請參閱同一RFC中的圖表:

foo://example.com:8042/over/there?name=ferret#nose

\_/ \______________/\_________/ \_________/ \__/

| | | | |

scheme authority path query fragment

| _____________________|__

/ \ / \

urn:example:animal:ferret:nose

所有這一切都假設您正在使用多個域,因為有關< img src =“./ relative / url / foo.png”>的問題.或img src =“/ absolute / path / while / domain / relative / foo.png”已多次回答.

總結

以上是生活随笔為你收集整理的php 跨区域,如何构造PHP的内容包括在非安全(http://)和安全(https://)区域以及跨多个目录使用?...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。