关于 Relative Reference url

大数据时代互联网安全越来越重要了,很多网站都开始实施全站https。

但是为了容错,当https服务不可用时,需要重新跳转向http,那么页面中的url到底是使用http还是https?

当然如果都写成https,当https服务不可用时所有访问都重定向到http,或当https服务可用时所有http都重定向到http都重定向到https,这样一旦

出现需要切换的场景,所有访问都要经过一次跳转是不能接受的。

所以采用 //www.domain.com/path形式的Relative Reference url,将所有页面中的url改写成这样的形式,只在入口访问的时候判断是http还是https,后面的所有

//www.domain.com/path的url都会解析成上一次访问的http或https(当然上次访问如果是其它协议,//www.domain.com/path也会解析成其它协议)。

比如当https服务可用时,http://www.domain.com/aaa被强制跳转到https://www.domain.com/aaa,那么这个页面中的"//www.domain.com/bbb"就会自动解析为

https://www.domain.com/bbb而不用再跳转一次,挨过来也不一样。这正是Relative的原意。

关于 Relative Reference的详细情况可以参见rfc3986的4.2章节。

时间: 2024-08-02 19:44:29

关于 Relative Reference url的相关文章

URI, URL, and URN

URI, URL, and URN A URI can be further classified as a locator, a name, or both. The term "Uniform Resource Locator" (URL) refers to the subset of URIs that, in addition to identifying a resource, provide a means of locating the resource by desc

Absolute and relative references in Excel

Keywords: Excel, fill multiple cells, formula, no series Absolute and relative references in Excel When you create a formula in Excel that refers to other cells in the worksheet, Excel will store the information about those cells as relative referenc

dubbo:reference

服务消费者引用服务配置.对应的配置类: com.alibaba.dubbo.config.ReferenceConfig       标  签                属性 类型 是否必填 缺省值 描述  <dubbo:reference>   id string 必填   服务引用BeanId  <dubbo:reference> interface class 必填   服务接口名  <dubbo:reference> version string 可选  

xlrd doc

The xlrd Module A Python module for extracting data from MS Excel ™ spreadsheet files. Version 0.7.3 -- February/March 2012 General information Acknowledgements Development of this module would not have been possible without the document "OpenOffice.

【转】 svn 错误 以及 中文翻译

直接Ctrl+F 搜索你要找的错 # # Simplified Chinese translation for subversion package # This file is distributed under the same license as the subversion package. # # Update to new pot: # msgmerge --update zh_CN.po subversion.pot # # Check translation: # msgfmt

Suricata.yaml

Suricata uses the Yaml format for configuration. The Suricata.yaml file included in the source code, is the example configuration of Suricata. This document will explain each option. At the top of the YAML-file you will find % YAML 1.1. Suricata read

RequireJS API

可以找到许多的解读,但是原文总是最重要的,也是最正宗的说明,直接访问 RequireJS 有时不太方便,这里将 RequireJS 2.0 API 的原文转载到博客园,方便查看. This is the RequireJS 2.0 API. If you want 1.0: Link to 1.0. Usage §§ 1-1.3 Load JavaScript Files§ 1.1 data-main Entry Point§ 1.2 Define a Module§ 1.3 Simple Na

HTML5设计网页动态条幅广告(Banner)

横幅广告(Banner): 1.横幅广告是网络广告的常见形式,一般位于网页的醒目位置上:当用户单击这些横幅广告时,通常可以链接到相应的广告页面: 2.设计横幅广告时,要力求简单明了,能够体现出主要的中心主旨,鲜明.形象地表达出最主要的广告意图: 3.横幅广告可以使静态图像,也可以是动态图像.一般而言,与静态横幅广告相比,动态横幅广告更醒目,更能吸引观众的注意力: 4.当然这还是在恰当适合的前提下(讨厌那种弹窗式和悬浮式的广告)使用不当会造成意想不到的后果,甚至因此观看者的反感造成恶性循环,从而对

6位数密码输入框

不管是PC端还是移动端,经常会有这样的,密码输入框 这里采取.6个li占位,上面覆盖一个 input输入框 <article class="pwd-area"> <input type="tel" id="password-input" maxlength="6"> <ul id="password-list"> <li></li> <li&