404 PHPSESSID URL’s
As we all know, its not great to be indexing content under multiple URL’s the reason being that it trips duplicate content filters in the search engines. Unfortunately this happened to us when we were mucking about with development of our Wordpress template. Anyway, should any off you wish to get rid of horrible PHPSESSID url’s then please feel free to use the following code.
if ($_GET[PHPSESSID]) {
header(”HTTP/1.1 404 Not Found”);
exit();
}
To be honest its not perfect by any means, it would for example be a lot better if the header location method redirected you to the non PHPSESSID version of the URL rather than just the home page 1) because the content is different and 2) because if you have other redirects with that page name in it may do those first.
If any of you care to improve on this I would be obliged as am too busy right now.
Also another thing you need to do is put a link to the PHPSESSID version of the URL so that the search engines pick up the re-directs. A link here for example would be fine.


























