Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2817
I've been thanked 80 times.
Offline
one thing that annoys me when i see people build websites is how they link bak to their home page.
And it's not just because it annoys me that i'm writing this post - it's also worth noting that by keeping the link url consistent, you may have a small seo benefit
if my domain is xeneco.co.uk (which it is) and my index file is index.php; i have the following options
[http://xeneco.co.uk]
[http://xeneco.co.uk/]
[http://xeneco.co.uk/index.php]
[http://www.xeneco.co.uk]
[http://www.xeneco.co.uk/]
[http://www.xeneco.co.uk/index.php]
I'm really starting to go off 'www' in the url as I am finding more sites that break if i can't be bothered to type it in
Back to the point
in server-speak (derived from unix) the forward slash is more than just a folder separator; by it's self it means 'root'
Therefore the easiest way to link to your home page is to just use '/' as the url in your anchor tags, eg
Code: html
<a href='/'>Home</a>
If you want to use a different domain, you can use the base tag. For example, if most of the links on one of my pages went to my blog I could use
Code: html
<head>
........
<base href="http://blog.xeneco.co.uk/">
</head>
<body>
<!-- Because of the base tag these relative links should always go to the right place, regardless of which site they are on -->
<a href='/'>Xeneco Blog</a>
<a href='/?p=8'>Build it and they will come</a>
</body>
Member
From: South Africa, Port Elizabeth
Registered: 2006-08-23
Posts: 1910
I've been thanked 34 times.
Offline
Generally what i have started doing is making all my links absolute. Like instead of ../animals/monkeys.php http://www.website.com/animals/monkeys.php
Then again, all my menus are php includes, so i can guarantee that every page on my sites have consistent navigation throughout. I also use link to images and style sheets like that. Linking back to the home page though, are you saying that use the forward slash is more seo friendly than the full url?
My up and coming... soon to be real website... www.thewebguy.co.za (one day i will finish it
)Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2817
I've been thanked 80 times.
Offline
Ryan_steyn wrote:
are you saying that use the forward slash is more seo friendly than the full url?
I'm saying it's more seo friendly than linking to index.php when all your external links to your home page are likely to go to the domain root (site.tld or site.tld/)
If, like me, you do a fair number of sites with different designs and database them all and where one application can power many sites it's a hell of a lot easier to just use '/'!!!
Member
From: South Africa, Port Elizabeth
Registered: 2006-08-23
Posts: 1910
I've been thanked 34 times.
Offline
ah, i see what you are saying... i also try dodge using the index.php part.
While we are in a similar area of discussion, have you noticed that the PR changes (This is what made me start avoiding links to index.php) from the root address "www.site.com" to the home page "www.site.com/index.php" - that bugs the crap outa me - exact same bladdy page in the exact same place - ranking differently.
So yes, you are one hundred percent correct - it should be considered best practice to use a forward slash or straight domain name. Linking to the actual page just stuffs sh#* up.
My up and coming... soon to be real website... www.thewebguy.co.za (one day i will finish it
)Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2817
I've been thanked 80 times.
Offline
Ryan_steyn wrote:
While we are in a similar area of discussion, have you noticed that the PR changes (This is what made me start avoiding links to index.php) from the root address "www.site.com" to the home page "www.site.com/index.php" - that bugs the crap outa me - exact same bladdy page in the exact same place - ranking differently.
Yep - There's two different urls, with two different sets of links pointing at them; makes sense that they would rank differently and have different PRs
Link consistency would avoid this
Member
From: South Africa
Registered: 2006-07-21
Posts: 294
I've been thanked 7 times.
Offline
Northie wrote:
[http://xeneco.co.uk]
[http://xeneco.co.uk/]
[http://xeneco.co.uk/index.php]
[http://www.xeneco.co.uk]
[http://www.xeneco.co.uk/]
[http://www.xeneco.co.uk/index.php]
It's interesting that you bring this up because I just logged in to make a similar post when I saw yours.
Anyway, what I wanted to say is that it hacks me off when people link to my site without the trailing slash because I go out of my way to ensure home page link consistency.
Just the other day I asked someone linking to my site to add a trailing slash to their code and they said "You won't get a duplicate content penality if you set your preferred domain in Google webmaster tools" - however I happen to know that Google only allows you to choose between having the 'www' and not. I don't get why they don't let you choose from all the options like you have listed there Northie, because seeing that they are different addresses, surely duplicate content penalty applies?
If you do happen to be running a site where you have different url's for your hompepage, then a way to relieve the problem is by using your .htaccess, and your robots.txt.
Just set up a redirect in your .htaccess to forward all unwanted requests towards your root.
To limit the negative impact your sie may have suffered from Google - with dupe content etc, just put a rule in your robots.txt stopping Google from indexing the unwanted url's.
Eventually, the site will be indexed properly, and all your dreams will come true. 
Member
From: South Africa, Port Elizabeth
Registered: 2006-08-23
Posts: 1910
I've been thanked 34 times.
Offline
That seems fine on a user level but does the htaccess transfer PR and link value across to whichever page it redirecting to? I know a 301 does for the most part but with htaccess and robots you could just be throwing away a whole bunch of traffic... clarification someone? Nice in theory though 
My up and coming... soon to be real website... www.thewebguy.co.za (one day i will finish it
)Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2817
I've been thanked 80 times.
Offline
How about forgetting robots.txt and .htaccess and just edit your internal links??????
I can't see how robots.txt would help and not everyone can use .htaccess as it only applies to the apache webserver (one could be using IIS, lighttpd, nginx,... the list goes on)
Member
From: South Africa, Port Elizabeth
Registered: 2006-08-23
Posts: 1910
I've been thanked 34 times.
Offline
Northie wrote:
How about forgetting robots.txt and .htaccess and just edit your internal links??????
I can't see how robots.txt would help and not everyone can use .htaccess as it only applies to the apache webserver (one could be using IIS, lighttpd, nginx,... the list goes on)
And that clarifies that....
My up and coming... soon to be real website... www.thewebguy.co.za (one day i will finish it
)| Never |


