Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to force search engines to default to index page?

Status
Not open for further replies.

GaryCam

Programmer
Dec 16, 2003
69
US
Hello all,
I have just finished a site with dozens of pages. Search bots crawl them all. That means that sometimes when a search is performed one of the internal pages will be returned in the results list. When that happens and the searcher clicks on that page in the results list he is sent to that internal page (duh!). Is there anything I can add to my code for that internal page so that anyone coming to it from outside the site itself is automatically sent to the home page instead?

Thanks in advance,
Gary
 
Why would you want to do that?

If the search engine is returning an internal page over the index, the reason is because it believes that the internal page is more relevant for that search term than the home page. By kicking everyone to the index, you are simply making it harder for them to find the specific information they are looking for and very likely you would make them look elsewhere.

Anyway, to answer your question; yes it is possible but by doing so you risk being banned from the search engines if they find out. Your pages should show the same content to search engines as they do for users, so if you only want visitors to your home page, block the spiders from indexing the other pages.

Hope this helps

Wullie

YetiHost - Quality Coldfusion 7/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Hi

Either you make the site for the visitors and let them visit it as they want, or make it for yourself and visit it as you want in your home.

When people search something with search engines, they want to see the relevant content, not what you think they should see.

I never visit sites where the webmaster tries to change my navigating habits.

Feherke.
 
Yes it's possible. You could put something in your .htaccess file that would redirect visitors to the home page dependent on their htp_referer. It would be pretty silly though.

Think about it: you're searching for widgets, you type "widgets" into a search engine, you get a list of pages about widgets, you click a link and you go to ... the home page of a site which has a widgets page somewhere inside it? How unfriendly is that?

Drop this idea - it's a stinker.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
OK, OK, Everyone. I see your point. I will leave the site as it stands.

Thanks for the mental flossing,
Gary
 
I agree with all posted replys. If the SE have indexed your pages they should be public.

If, for some reason, you would have the SE bots NOT indexing certain folders, then you can make a robots.txt file like this

Code:
User-agent: *
Disallow: /internal_stuff/

and place it in your webroot. Then no files/folders in the /internal_stuff folder will be indexed by bots.

If you're on a Apache server, then place this file in your webroot:

[tt].htaccess[/tt] ... yes, that IS the name.

Code:
ErrorDocument 404 /index.html

That would refer all broken (or not accessible) links to your /index.html

But, like the rest of the guys says -if the pages are indexed by SE robots you would want them public, right?




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top