Why relative URLs should be forbidden for web developers * Yoast - 12 views
-
Relative URLs are often used because developers have a test environment on another hostname and it makes it easy for them to move stuff between their test environment and their live environment.
-
The useful cases are when it’s used inside JavaScript or CSS, so files are served over the same protocol as the current page, especially because when you’re on a https URL, serving anything over http basically breaks the security.
-
Using protocol relative URLs within links or canonical URLs is a very bad idea though, because you can still have duplicate content issues between http and https versions of a website.
- ...1 more annotation...
-
- ...1 more comment...
-
I don't understand the issue. web developers have to use relative url's and it is best practice. If it's a protocol issue, it's common knowledge to use the double slash (//) in front of the url. Problem solved.