Disallow: /?product=*
Think that would work, test it in google sitemaps though
I need some help with .htaccess or equivalent. What's the most efficient way of stopping Google indexing my home page with these appended parameters?
www.shopcodes.co.uk/?product=burberry
www.shopcodes.co.uk/?product=calvin_klein
www.shopcodes.co.uk/?product=prada
If you do searches and my site appears, often the three urls above appear. I don't want the above indexed as they are currently but I obviously want it to index
www.shopcodes.co.uk
Google is sometimes returning these two urls below as first and second listings but the pages are exactly the same.
www.shopcodes.co.uk
www.shopcodes.co.uk/?product=prada
The "product" urls are a hangover of when a site I once owned redirected to Shop Codes. There's a site still linking to those pages with the "?product" parameters in but removing all those links would be a painful process.
So I am looking for a safe .htaccess or robots.txt solution that won't harm the indexing of the 'real' homepage.
Disallow: /?product=*
Think that would work, test it in google sitemaps though
if its a script that handles the ?product= part which I imagine it will be tell google that its moved something (in php) like...
at the very top of the index / default page, then if you go to http://www.shopcodes.co.uk?product=anything it should do a 301 permanent redirect to the main page, google should then eventually forget about the ?product URL's rather than just ignorning them whilever the robots file is therePHP Code:if ($product) {
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.shopcodes.co.uk" );
}
Dan Morley
alpharooms.com
daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
My Blog | Cheap Holidays
Thanks tbp and Dan. I've implemented both.
Cheers,
Ray
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks