httpgoogle-crawlersprotocol-relative

Do protocol relative URLs affect search crawler behavior, and how?


We are working on a web application that will have a preview environment (https) and live which would be (http). Now considering there would be two different schemas involved we have used href for links in HTML page as protocol-relative URLS as we wanted to use absolute URL for links and we didn't want to bother about HTTP/HTTPS in url.

Now we would like to understand how it would affect search crawler behaviour, if at all.


Solution

  • It should be completely fine to use them to serve assets ( Wikipedia uses protocol relative urls.) Using protocol relative URLs within links or canonical URLs, should be avoided.