one of my sites which is a blog directory in php has a problem with page rank. the problem is : the page http://www.myblogdirectory.net is ranked PR4 and the page http://www.myblogdirectory.net/index.php is ranked higher at PR5 what should i do to remove this PR difference please help to the moderator , my problem is genuine and requires the listing of links .
Never use "index.php" part while registering your site in directories and placing links. Theoretically now you can set up a permanent 301 redirect to pass rank from "index.php" to the site root. You can try the following PHP code, place it in the beginning of the file. Please note I wrote this code in 1 min so no warranty. Also, this code ignores GET parameters, so it could not be used if you have forms passing parameters to the /index.php url. Code: if ($_SERVER['REQUEST_URI'] == '/index.php') { header('Location: http://www.myblogdirectory.net',true,301); die(); } PHP:
wmtips thanks for your reply yes i pass parameters so this won't work for me for example http://www.myblogdirectory.net/index.php?id=12345 to count the no. of referals any other solution???
Sorry, I was wrong. It will not redirect if you have GET parameters. To prevent redirect if you have POST parameters it could be as follows: if ($_SERVER['REQUEST_URI'] == '/index.php' && !count($_POST)) { header('Location: http://www.myblogdirectory.net',true,301); die(); } PHP:
Just do a 301 and you should be set, Your job is not to transfer the pagerank, but stop googlebots from thinking its duplicate content
Hello, if anyone need more information about 'url canonicalization' read Google's Matt Cutts' post here : http://www.mattcutts.com/blog/seo-advice-url-canonicalization/
Thanks everyone for your input and a special thanks to wmtips for providing me the code (i have implemented this code , hope it help solve my problem). i am giving u a free 1 month link back to ur site wmtips.com from my blogshowoff.com PR5 site .