比如说我希望/a/的走https,而/b/的走http
在过滤器中解析url,符合a链接规则的且协议是http的则跳转到https,b同理
如果使用了jquery,可以这么干
$(document).on('ajaxSend', function (xhr, options) {
if (location.protocol.indexOf('https') > -1) {
options.url = 'https://www.xxx.com' + options.url;
}
})
总之一句话,在某一处地方处理,方便维护。千万别在页面里写死链接