I have a website that is in quite a mess. All the following links, though pointing to the same thing have different PR and computed backlinks. http://mydomain.com http://www.mydomain.com http://mydomain.com/index.php I think i need to redirect all of them to one place properly, preferably http://www.mydomain.com. Can someone advice on how I should modify the .htaccess file? Or is there a better alternative? Tks!
Without having access to your site / .htaccess file I can't really say, it should take about 2 or 3 .htaccess Rewrite rules to get the job done though
Try to add these lines to .htaccess: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www.mydomain.com$ [NC] RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301] RewriteCond %{THE_REQUEST} ^.*\/index\.php RewriteRule ^(.*)index\.php$ http://www.mydomain.com/$1 [R=301,L] This comes from a couple websites I just found, so it's not tested by me. Just change mydomain to your domain name.