Forum Moderators: open
I'm using a tab view on my home page, the designer made it with a php code that create an id variable for each tab, i discovered it few hours after uploading the new design, and replaced it with html tab view that wont create an id variable.
few days before i discovered Google indexed my home page in 2 versions:
example.com/index.php and example.com/index.php?id=1
I know a solution will be to redirect index.php?id=1 to index.php with a 301.
But im on IIS6 windows server, no rewrite module available. there is any other solution?
Google didn't crawl the index.php?id=1 since 11-nov, but i want to make sure its removed. how?
Thanks ina dvance
- Check for the query string when index.php loads
- If the value of id=1 then redirect to itself without the querystring.
here is example code to redirect
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.example.com/" );
?>
Note: A better option is to redirect to the root (ie. without the index.php). But I'm pretty sure you would need some kind of rewrite tool for this, like ISAPI Rewrite
Since its only a one page problem (id=1 only Google bot saw it once before i fix it, and will never see it), so do you think placing this:
<link rel="canonical" href="http://www.example.com/" /> in the header of the home page will solve the problem and remove the id=1 version?, i mean better than using a code in the header to redirect the page.
Does the index.php page ever get called with other querystring values? (ie. id=3, id=3 etc.) If so, the canonical attribute will give you more problems than it fixes.