I am new to deep linking, so not sure how to do this. In order for the web site to be crawl able by all crawlers, I am using Hijax method which basically means all my links are tagged as follows:
<a href=”index.php?foo=32”
onClick=”navigate('index.php#foo=32'); return false”>Link</a>
Due to this schema all of the pages on the web site are replicated in AJAX and in PHP (I use same PHP files to generate data for both, so I am not really retyping the code twice in PHP and Javascript).
Basically what happens is that on the initial load of the page PHP generates the HTML content of the page and then AJAX alters the content according to the hash value (#foo=32
) whenever user goes to a link on the page. This allows search browsers to index the site since PHP generates all the content for every page, and users with support for AJAX get to can enjoy AJAX if they navigate to a different page on the site.
What I am having trouble with is the following. My home page loads simply as index.php
. According to the specs of the URL fragment, fragments are NOT sent to the server - meaning PHP can't know if the user typed a fragment in the URL. So, lets say the user bookmarks the page with the URL index.php#foo=32
, whenever user will try to load that page, since PHP does not know that the fragment was added to the URL, the sever returns the HTML code of the home page, and as soon as the home page is loaded, document.onload
event is triggered and Javascript (I am using SWFAddress library to deep link) checks the hash value and alters the page to display whatever index.php#foo=32
is suppose to display. I don't like this because it is inefficient and is not very user friendly. User has to see the home page and only then something reloads.
So, the question is: How is this approached in the industry or how should I design things so that the home page is not loaded when user tries to access index.php#foo=32
.
Thank you in advance. I would appreciate any help.
EDIT:
Here is the idea of Hijax described which enables AJAX deep linked sites to be indexable by crawlers: http://googlewebmastercentral.blogspot.com/2007/11/spiders-view-of-web-20.html