Topic: function.redirect_to.php
Hey all,
[This is not a bug]
Here is my modification of the function.redirect_to.php file and a little suggestion regarding the SEO features (explanation will follow):
function redirect_to($url, $status = '')
{
switch($status) {
case '404':
header("HTTP/1.1 404 Not Found");
header('Location: ' . $url);
break;
case '301':
header("HTTP/1.1 301 Moved Permanently");
header('Location: ' . $url);
break;
default:
header('Location: ' . $url);
exit;
}
}
and a small modification in index.php (Line 198)
redirect_to(BASE_URL . 'page-unavailable/', '404');
Explanation: if you access a link that does not exists (let's say BASE_URL/bla-bla/), you get redirected to the "page-unavailable/" but the headers sent are 200 - OK, which, for Google or other search engines, means that the page actually exists and can be indexed.
So, if you specify the '404' code, the headers will send the 'Not Found' status and the link is not indexed.
Also, i did added the '301' status code, which means that the page was permanently moved from a location to another. I'm thinking here at moving, let's say, a job from a category to another (by the way, can this be done ? ).
That's it, thank you for your attention ![]()