Absolute vs. Relative Links – Which is Better?
There are two ways to link to a file/page/location in HTML, either by using absolute or relative paths: An absolute path defines a location by including the protocol, the server/domain, the directory (if needed) and the name of the document itself. Below is an example of an absolute path: With a relative path, you skip the protocol and server/domain name and go directly to the page name, like so: So which is better? Well you’ll get different responses depending on who you ask. Many people will tell you that relative paths are better but I’m not one of them! I always recommend absolute paths and here’s why: At one point GoogleGuy, an employee of Google, who helps fight crime — or at least helps webmasters — said, and I quote, “absolute links have less potential for getting messed up [when Google indexes your page]. Even though it shouldn’t make a difference, I recommend absolute links.” OK, sure, maybe just because Googl