Quote:
Originally Posted by nathan.joshua
Ok I found a solution for this:
Add this to your .htaccess:
Code:
RewriteCond %{QUERY_STRING} !=""
RewriteRule (.*)$ http://www.mydomain.com/%1? [R=301,L]
What this does: All query strings from the homepage, like homepage.com/?p=1 will auto redirect to your home page.
Still trying to figure out how this happened in the first place  .. who cares, problem solved 
|
I'd be vary careful with that solution. It's like using a sledge hammer to fix a ding. You will most likely break a lot of other things. e.g. campaign tracking code, AdWords landing pages, internal paging, social links with tracking code...
What was the original redirect code you tried? Let's try and fix it. Show us any other rewrites/redirects you also have as this may give light into why you caused a redirect loop.
It's not just your own website that can cause Google to index funny pages:
Any previous versions of your website may have used that page. Google has a long memory.
Check your xml sitemap generate and rss feed. They can also tell Google lies.
Other website may link to that page. I see a lot of random indexed pages on my website due to crappy domain info websites with buggy link generators.