Este sitio web utiliza cookies para realizar análisis y mediciones de tus visitas. [ Acepto ] [ Más información aquí ].

Relative URLs vs. Absolute URLs: Which one is better for SEO?

In order to create hyperlinks, and to call Javascript and CSS files, you should decide between using absolute URLs or relative URLs, since this will have a major impact on your website's indexation. An absolute URL includes all parts of the original URL, while the relative URL ignores some parts to make it shorter.

Absolute URL:

Relative URL: /css/style.css

Relative URLs have the advantage of shortening HTML content, but they can be more risky, since they require advanced configuration of the .htaccess file (read "How to Add Slashes at the End of URLs" and "How to Remove Slashes from the End of your URLs"). If you are not careful about this, new undesired paths will probably appear under subfolders, which will affect navigation and will generate duplicate content. Xenu can detect if a website suffers this problem when many subfolders start to appear.To avoid these risks, just use absolute URLs. Even if they're longer, they guarantee URLs will always be the same. In 2009, Matt Cutts recommended absolute against relative when writing canonical URLs. This is also good for internal links, images, and Javascript and CSS files.

Añadir comentario