Forum Moderators: Robert Charlton & goodroi
Get the script to test the requested URL and for all non-canonical versions of the base URL for each page make sure that it adds a <meta name="robots" content="noindex"> tag to the page.
/photo-page-name.html
/photo-page-name.html?g2_enterAlbum=0
I am wondering whether just having that extra string after the? is enough to cause problems? If I have to add a 301 redirect for each image then the htaccess file will be huge!
The second line of the rewrite rule would be something like:
RewriteRule ^/(.*)?(.*)$ http://www.domain.com/S1 [R=301,L]
I am not so sure what you would have in the first line of the rule, the RewriteCond part, but I assume that testing for a URL that includes a ? would be close to the mark.
That's a question for the Apache forum here at WebmasterWorld :-)
I get by, by taking a guess and tweaking it until it works.
I do that on a development server so that real sites don't get taken down if the rules crash the server (they can, and often do, while I am testing).
.
It's heartening to know that even Danny Sullivan [daggle.com] finds this stuff difficult. However, I would not have done it like that!