How to re-direct/fix a bad Google index

Sharksfan

New member
May 28, 2009
1,086
22
0
WI
I have an EPN/A2P site that is using the Classipress template.

That in and of itself shouldn't really affect the issue though - just some background.

The page URL in the Google index for this is:

hxxp://xxxxxxxxx.com/?sort=meta_value&key=price&order=asc

I have no idea how that got to be in the index. And when that particular link is used zero product listings show up. The user just see a blank product page - naturally the bounce rate is like 99%.

The link above is domain-root link with some URL encoded options - so I can't do a 301 redirect on it - and I'm still trying to figure out how to fix this so it refreshes correctly.

Any other ideas?
 


PHP:
<?php
if (($_GET['sort'] == "meta_value") && ($_GET['key'] == "price") && ($_GET['order'] == "asc")) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newpage.com/");
}
?>
This should redirect that specific link to whatever URL you want.
 
  • Like
Reactions: Sharksfan
PHP:
<?php
if (($_GET['sort'] == "meta_value") && ($_GET['key'] == "price") && ($_GET['order'] == "asc")) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newpage.com/");
}
?>
This should redirect that specific link to whatever URL you want.

+rep - that's exactly what I needed.

I was messing around with MOD rewrite a bit too but didn't get it to work yet - many, many thanks!
 
Okay, follow-up question - maybe I'm being a moron...

I'd have to do this in the .htaccess wouldn't I?
 
Okay, follow-up question - maybe I'm being a moron...

I'd have to do this in the .htaccess wouldn't I?

If you're talking about the PHP code I posted above, just put it at the very top (before <html> tag) of your index.php file.