Forum Moderators: Robert Charlton & goodroi
Here's a quote of what GoogleGuy said in the past:
My rule of thumb is to pick a root page and be as consistent as possible. I lean toward choosing [yourdomain.com...] but that's just me; [yourdomain.com...] would work as well. Then I recommend that you make things as simple as possible for spiders. I recommend absolute links instead of relative links, because there's less chance for a spider (not just Google, but any spider) to get confused. In the same fashion, I would try to be consistent on your internal linking. Once you've picked a root page and decided on www vs. non-www, make sure that all your links follow the same convention and point to the root page that you picked. Also, I would use a 301 redirect or rewrite so that your root page doesn't appear twice. For example, if you select [yourdomain.com...] as your root page, then if a spider tries to fetch [yourdomain.com...] (without the www), your web server should do a permanent (301) redirect to your root page at [yourdomain.com...]Now here's my probably rather n00bish question: "what are absolute links and what are relative links?" Is an absolute link for instance "http://www.yourdomain.com/subpage1.html" and a relative link "subpage1.html"?
And so GoogleGuy here does say that also for internal linking the absolute links are preferred? Cause I always thought that was considered spam...
Another reason to use absolute links is to get some benefit when people steal your content.
Absolute links are very helpful with DMCA complaints. Many content thiefs don't change absolute links to images for example. I had some very succesful DMCA complaints by just stating "you can see on the copied page at www.thief.com that the images are still loading from www.owner.com". Complete sites were blocked by the hosting company within 24 hours.
Also if someone is 302 hijacking your page, all links from the hijacked page are still pointing to your site, not the hijacker. So you will still receive some traffic via the hijacked page. There have also been posts on this board that the chance of being hijacked is smaller when you use absolute links throughout your site, because the Google algorithm can easier determine which URL is the original, and which one the copy.
If you don't want to change all the internal links, you could use the <base href="www.yourdomain.com/file.html"> in the head section of each page. This tells the browsers and bots that all relative links on the page should be calculated as if the current HTML file is www.yourdomain.com/file.html. This has some of the advantages mentioned above and is in general not a large amount of work, especially if you use common headers in PHP, SSI, ASP or another server side scripting language.
Absolute Link:
<a href="http://www.webmasterworld.com/forum30/">Google News</a>
Relative Link:
<a href="/forum30/">Google News</a>
> The way you build your links has no impact on SEO,
It has in the past because of spiderability issues and it may in the future. I have a popular browser here on my phone that has difficulty with relative links in it's own cached pages. How many bots is that true for today? Even Google itself had difficulty with relative links in its own cached pages in 2000-2001.
> I recommend absolute links instead of relative links
Ditto where possible. However, the bandwidth savings from relative links on high traffic sites is significant.
I always count from the root /folder/subfolder/page.html
If you have a 301 redirect set up from non-www to www then you can still use relative links, with a low risk. Without a redirect you will have duplicate content issues.
When you link to an index page do not include the index file filename in the link. End the link with the trailing "/" on the URL. Link to / or /folder/ or http://www.domain.com/ or http://www.domain.com/folder/ only.
Always include the trailing / on the end of the URL when you link to a folder.
But avoid using ../folder/file.html type paths, those are a real pain to maintain longterm, always start from the root, /folder/file.html, as g1smd says.
"Even Google itself had difficulty with relative links in its own cached pages in 2000-2001."
that was a long time ago. What cellphone browser are you having trouble with?
If you run a development version of your site locally using relative links is the way to go, you can use scripting to replace them with absolute ones when the pages run on the web server, but what a pain...
One person's pain is an essential part of another's an quality control steps.
I use an uploader to make pages live. As it uploads them it expands all relative links to absolute ones. Also it:
I end up with a site that is 302-hijack resistant, and has had a lot of quality checks run pretty much for free. No pain and a lot of gain.
You will move your site to a different domain name in the future. Or once your site is finished, you will probably give up the domain or the hosting related to the domain
I guess this is only true for a minority of the webmasters. Most of us want a long and successful existense on the web on a branded domainname.
Also putting a website on a CD-ROM or harddisk to work is getting more and more difficult today as the percentage of server side script driven sites (PHP, ASP, etc) is ever increasing. Only plain HTML type websites can be transferred to a local disk without any rewriting or installation issues, but as this eliminates the visibility of the site, it is hardly what most webmasters are aiming.
That's not true, where did you get this idea from? I only have to add one thing to run my sites locally, some httpd.conf stuff, they are all developed locally, then installed on the server.
Obviously if the site is created from a database, like some forums, cms systems etc, you'd have to load the database contents too to duplicate the sites, but that's not very hard.
That's not true, where did you get this idea from?
philipkd was mentioning viewing a site from a local CD-ROM, or putting it on a local disk for archiving purposes. If you want to do this with only a browser, you need the website to be in plain HTML. Of course you can install a database server and httpd server, but IMHO this was not wat he was talking about.
If there is any sort of server side processing in the source files (SSI, ASP, PHP, database access or whatever) you need to install server software to process the source.
with "(...) some httpd.conf stuff" you are already assuming that there is a local web server running.
Obviously if the site is created from a database, like some forums, cms systems etc, you'd have to load the database contents too to duplicate the sites, but that's not very hard.
Load the database assumes again that the necessary software is already in place, which I would call "installation issues". Also, how would you run a website from a database if it is viewed from a read-only CD-ROM? MOst CMS software needs write access to the database just to start up.
On the other hand, if having absolute links is really that importnat, ASP.NET provides an easy way to do that if you use the "server controls" and use the tilde character (~) to represent your home path.
Nevertheless, I really don't think that any modern search engine would have any problem with relative links