The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 21, 2019, 02:21:53 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: How do you code your site to prevent google bots from marking directories broken  (Read 3440 times)
webinfoguy25
Journeyman
***
Offline Offline

Posts: 56


View Profile
« on: June 08, 2010, 03:08:18 PM »

How do you code your site to prevent google bots from marking directories broken when href= something that starts like this: (../
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: June 08, 2010, 04:25:47 PM »

That's a relative URL. That means "Move up one dir, then back down into (whatever follows) or that item specifically means get the index.html page one directory up.

My recommendation: Do not use relative urls. Always start URLs with / so that Google knows precisely where everything is. Relative URLs can be really hard to debug in a large site, and there's no reason for them at all (without looking at really advanced implementations and black stuff).

Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
isthisthingon
Global Moderator
Lifer
*****
Offline Offline

Posts: 2879



View Profile
« Reply #2 on: June 08, 2010, 05:59:33 PM »

Related link.
Another related link.

Not sure if ranking is your priority or simply fixing the Google-break.  Links such as the following should be the same to Google:

Absolute URL:
Quote

Relative URL:
Quote
href="/directory/somepage.htm"

Absolute links potentially add unnecessary weight to your pages which, if performance is effected, may negatively impact your ranking at Google.  That said, most people still prefer absolute URLs and in your case it would also fix your problem
« Last Edit: June 08, 2010, 06:03:24 PM by isthisthingon » Logged

I would love to change the world, but they won't give me the source code.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #3 on: June 08, 2010, 07:10:57 PM »

It's been kind of assumed that anything that starts with / is an absolute rather than relative URL, because you're claiming the dir hierarchy from the root of (wherever your web pages are). If you start with / then the domain is assumed. On the other hand, if you start with anything OTHER than / then it is certainly a relative link.

It's like the difference between these 3 statements:

rm /adir/another/file.txt -- remove file.txt in (root)/adir/another
rm ../adir/file.txt -- remove file.txt that is one a directory one up from me then into adir
rm adir/file.txt -- remove file.txt which is in the directory adir below me

URLs work exactly the same way. This immediately looks to be cool. It is not, because it makes page position in a website dependent on current position. It's particularly troublesome for spiders and scrapers. Net-net: I'd not use relative URLs unless it was absolutely necessary. And I've never found it absolutely necessary Wink
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
isthisthingon
Global Moderator
Lifer
*****
Offline Offline

Posts: 2879



View Profile
« Reply #4 on: June 08, 2010, 07:48:54 PM »

I truly have no opinion either way since SEO is not in my bailiwick.  However, the points on both sides are interesting Smiley
Logged

I would love to change the world, but they won't give me the source code.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #5 on: June 08, 2010, 08:56:20 PM »

Actually I'm speaking purely from a management perspective.

I've created several sites (a great long while ago) where I used relative URLs and created logical loops that spiders got caught in and they never went away. There is no benefit, as far as I can see and IME to relative URLs (from an SEO perspective) so I don't think it's a good idea to use them.

Not disagreeing with you, just trying to clarify. Smiley
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!