我的服务器上有我的网站
http://www.myserver.uk.com
Run Code Online (Sandbox Code Playgroud)
为此,我有两个域:
http://one.com
Run Code Online (Sandbox Code Playgroud)
和
http://two.com
Run Code Online (Sandbox Code Playgroud)
我想用PHP当前域,但如果我使用$_SERVER['HTTP_HOST']
然后这给我看
myserver.uk.com
Run Code Online (Sandbox Code Playgroud)
代替:
one.com or two.com
Run Code Online (Sandbox Code Playgroud)
我怎样才能获得域名,而不是服务器名称?我有PHP版本5.2
此问题涉及浏览器行为以及用于链接,导入,包含或从网页,js文件或css文件中调整CSS,JS,图像和其他文件的协议规范.
在测试静态文件和压缩内容交付时,我发现如果您不再使用约定,很少有浏览器会产生问题.喜欢:如果你不Content-Disposition: inline;
为所有内联CSS,JS等文件发送标题,IE6会产生问题,如果你使用.gz
像文件扩展名那样,一个不太旧版本的safari不能正确处理gzip压缩文件main-styles.css.gz
.
我想问一下浏览器关于Content-Type
响应头的行为.既然<link>
,<script>
并<img>
已指定内容类型,可这头被安全地跳过,或者做一些浏览器需要它由于某种原因?
我不确切知道怎么问,所以我会尝试用一个例子来解释.
我有这些资源example.com
,一个HTTP/2
启用的服务器:
//example.com/css/file.css
//example.com/js/file.js
//example.com/images/file.png
Run Code Online (Sandbox Code Playgroud)
我想要的是通过cdn.example2.com
指向域的别名域加载其中一个文件example.com
.因此,HTML中的实际资源应如下所示:
//example.com/css/file.css
//cdn.example2.com/js/file.js -> points to //example.com/js/file.js
//example.com/images/file.png
Run Code Online (Sandbox Code Playgroud)
我的问题是:第二个例子中的所有资源都应该由浏览器通过单个连接加载,因为当没有别名域时它们会被加载吗?
感谢帮助.
根据维基百科:
并非所有字节序列都是有效的UTF-8.UTF-8解码器应准备好:
Run Code Online (Sandbox Code Playgroud)1. the red invalid bytes in the above table 2. an unexpected continuation byte 3. a start byte not followed by enough continuation bytes 4. an Overlong Encoding as described above 5. A 4-byte sequence (starting with 0xF4) that decodes to a value greater than U+10FFFF
根据代码页布局,0xC0和0xC1无效,绝不能出现在有效的UTF-8序列中.这是我对0xC0和0xC1的看法:
Byte 2 Byte 1 Num Char
11000011 10000000 192 À
11000011 10000001 193 Á
Run Code Online (Sandbox Code Playgroud)
有些字符对应于这些字节序列,但不应该有.我做错了吗?