Topic: Very small SEO adjustment
This code will only be used in few situations, but will make sure search engines won't index double content at job pages. The difference in the URL between the page description pages and all others is that they rely on the ID within the URL, instead of the the title in the URL.
What I'm basically saying is that "jobberbase.com/job/11/a-sample-job" would work just as well as "jobberbase.com/job/11". In most cases this wouldn't matter, but in the following cases a different URL could appear:
- You edit the job title later when it's already indexed. Search engines will see it as a new page but are also still able to see the old (thus concluding it's double content).
- You don't have enough room to post a full URL and want to shorten it (like the twitter script of MPLOYR.com)
- Someone makes a typo in the url and posts it somewhere (which google will find eventually)
Anyway, all it does is compare the url with what it should be and if they aren't the same it 301 redirects (permanent redirect). That way the search engine replaces its known version with the proper one (and if it had a PR or so it'll transfer that too!).
1. Open /page_job.php
Find:
$url = BASE_URL . 'job/' . $id . '/' . $info['url_title'] . '/';Replace with:
$url = BASE_URL . 'job/' . $id . '/' . $info['url_title'];
$current_url = 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
if ($current_url != $url) redirect_to($url, 301);
Note that for the redirect function to work correctly you need jobberbase 1.6 or the redirect modification posted on the forum.
Updated for 1.7 Support
Last edited by Chronos (2009-07-21 12:46:24)
Visit my Blog: ChronoScripts (JobberBase scripts, support and freelance)
JobBoards: Telefonisch Werk and Top Bijbaan