I am using jQuery for a simple website and have a main page ‘index.html’ which can load some content (e.g. ‘info1.html’ or ‘info2.html’) via jQuery ajax requests, and display the result of these requests inside an element in the ‘index.html’ page.
If a user somehow visits say ‘info1.html’ directly, is their a way to redirect or load the main ‘index.html’ page? (or what’s best practice for this type of thing) as Google is indexing all the small html files used for the ajax requests and sometimes a user can click into the site via these pages.
Thanks.
Workaround 1:
since jquery will pick the content inside the body tag by default, you could add in the head element a script to redirect you to the main page or a meta tag ( more correct ) as Daniel mentioned.
Workaround 2:
if your ajaxed files are inside a folder you could use a robots.txt file and direct google to not index pages in those folders..
or you could do it directly from inside those pages (look at http://en.wikipedia.org/wiki/Noindex )