Can I use a protocol-relative <base> tag?

前端 未结 2 1510
醉梦人生
醉梦人生 2021-02-19 18:08

Protocol-relative URLs make it convenient to include resources (images, CSS, JS) using the same schema (HTTP or HTTPS) as the original request, while keeping only a single copy

2条回答
  •  深忆病人
    2021-02-19 18:45

    We just attempted this with a site and Google's crawler did not understand how to use a protocol relative path as the base and we ended up with it indexing many broken urls.

    I'm not sure if using a protocol relative path here is an acceptable value for the base path. Browser's seem to understand the protocol relative base just fine, but it could be that they are just more lenient in what they will accept.

提交回复
热议问题