404 PHPSESSID URL’s

September 21st, 2007 | No Comments Yet | By Allan Stewart

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 which effects your seo. 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 much obliged as am too busy right now.

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.

Subscribe to our feed.

Or skip to the end and leave a response.

Have your say...


Copyright 2007 FireflySEO. Bookmark us now! Press Ctrt + D!