My site has dynamic pages which look like
www.mysite.com/?page&news_id=1
This is changed into www.mysite.com/news/1 by mod rewrite rules in my site.
How do I stop Google from indexing some of these dynamic pages?
|
My site has dynamic pages which look like
This is changed into How do I stop Google from indexing some of these dynamic pages? | |||||||||
feedback
|
This question came from our site for professional and enthusiast programmers.
|
| |||||||||||||
feedback
|
|
Do not BLOCK those pages. Instead redirect the "old" pages to the new, clean ones... | |||
|
feedback
|
|
Get create ROBOT file. | |||||||
feedback
|
|
What you want is a robots.txt file. If you're using Google Webmaster Tools, they even have a tool and instructions to help you generate one. It's also quite simple to write one on your own. (Definitely simpler than using mod_rewrite) Both Wikipedia and the original spec have examples. Sitemaps are useful, but robots.txt is still supported by a wider variety of crawlers... which, given your goal, seems to be something you'll want. | |||
|
feedback
|
|
the best bet is to give google a sitemap of the URLs that you do actually want them to index - more information can be found about this http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156184 | |||
|
feedback
|
|
In pages that you don't want Google to index, check the user agent string in the http request. If it contains 'Googlebot' then you know its Google spidering your site and you can return a suitable http response code such as 401 Unauthorized. | |||
|
feedback
|