I've been optimizing my website html code recently and I'm now at the point where I want to reduce the size of my css and html files as much as possible for quicker loading and better text to code ratio. I was wondering in my html code for internal links if I use href="/" instead of the full url href="http://www.mydomain.com/" is it as good for SEO? I guess its the same if I use href="/subpage/subpage.html" instead of href="http://www.mydomain.com/subpage/subpage.html"? Thanks! Vincent
From your example, going to subpage.html from your root directory you can use: href="folder/subpage.html" which means you don't need to put a "/" in front of folder - it won't work. And if, for example, you are on subpage.html (which is inside a folder)and want to link to a page in the root directory (outside the folder) you just use: href="../index.html" without typing your whole domain, not even the folder name, but you must specify the page in the root directory (index.html in the example). Now, if your subpage.html is two pages deep, e.g. folder1/folder2/subpage.html, link to index.html using: href="../../index.html" I hope this helps.
Thanks for the clarification. But let say in my header logo I want to add a link to my frontpage (like the Digital Point logo up here). If I use href="/" with anchor "Digital Point" will it be as good as if i used href="http://www.digitalpoint.com/" with the same anchor? Is the second one stronger SEO wise? I mean when a search engine crawls my page and sees href="/" do they all know that it's a link to my front page?
Yes "/subfolder/subpage.html" is the same as "http://www.example.com/subfolder/subpage.html". The key is that you either want to use fully qualified URLs like "http://www.example.com/subfolder/subpage.html" or root relative URLs like "/subfolder/subpage.html" (root relative meaning the relative URL always starts with a '/'). Avoid using folder relative urls in HREF attributes like "../subfolder/subpage.html" or "../../xxx/yyy/zzz.html" or "./subfolder/x.html".
Same thing, but you're more prone to making mistakes in the coding. By the way, using full paths in PHP if faster.
Just to throw this out, I would use the entire url. This way, in case you get your content scrapped by another site, you get the links back instead of having those links juts point to their site.
Full paths are the way to go IMO...They are both the same in engines eyes, relative and full...but the reason I ALWAYS use full path is so when people send their bots out to scrape content, they link back to my site ...Just fun stuff right there. But seriously, it really doesn't matter...I alwasy advise to use absolute URL's instead of relative. Some popular CMS's actually have the option to edit urls with relative and they will append the aboslute path....so you type images/whatever.png and the good folks that wrote the cms will have it automatically throw it up like http://www.whateverishere.com/images/whatever.png