Forum Moderators: phranque
redirect 301 /example.htm?leech.com h*tp://www.domain.org/example.htm
I've had a "directory" link to my pages recently that's using the? method, and the URL's are returning 200's. No harm yet in the serps, but it's dupe content.
Many thanks to anyone who can be of help on this - maybe that redirect isn't the way to go? Can I do it with mod rewrite?
[edited by: jdMorgan at 5:55 am (utc) on May 7, 2006]
In mod_rewrite:
RewriteCond %{QUERY_STRING} ^http://(leech\.com¦dummy\.com) [NC]
RewriteRule ^example\.htm$ http://example.com/example.htm? [R=301,L]
Jim
RewriteCond %{QUERY_STRING} ^(leech\.com) [NC]
RewriteRule ^mypage\.htm$ h*tp://www.mysite.org/mypage.htm? [R=301,L]
The leech site didn't have an http:// at the front. The ¦ is just to add other leech sites is it?
Is it possible to do it site-wide, for anything that comes in with the query string? I've started reading up on htaccess and query strings (I've read of query strings here, but didn't realize they were the url's with the "question mark" - I never use the things), so might eventually figure it out myself. Great start anyway.
Added: I have over 400 pages, and that "directory" has so far only linked to one page, but if they link to a lot of others, it's many entries in my htaccess if I have to do it one at a time. Because I don't use query strings, I figure it should be possible to change /anypage.htm?leech.com to /anypage.htm