WebsiteBaker Community Forum

General Community => Global WebsiteBaker 2.8.x discussion => Topic started by: Tez Oner on February 11, 2016, 10:01:59 PM

Title: 302 Language Redirect SEO issue
Post by: Tez Oner on February 11, 2016, 10:01:59 PM
Hey,

had some 'funny' issue discovered by a 'SEO optimise company'. I seems that WB
(when using multi-languages) redirect the page with a header 302 status - not that
good as it won't return a 200 OK.

It turns out that the issue lays in:

/framework/class.frontend.php - line ~ 139

There is:

Code: [Select]
if ($this->page['language']!=LANGUAGE) {
if(isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') { // check if there is an query-string
header('Location: '.$this->page_link($this->page['link']).'?'.$_SERVER['QUERY_STRING'].'&lang='.$this->page['language']);
} else {
header('Location: '.$this->page_link($this->page['link']).'?lang='.$this->page['language']);
}
exit();
}

So dependent on the language it redirect, but in this way it would be an 302. Better would be
deleting the whole part (no 301 / 302 but directly a 200 OK). But as 301 are fine it also can be:

Code: [Select]
if ($this->page['language']!=LANGUAGE) {
if(isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') { // check if there is an query-string
header("HTTP/1.1 301 Moved Permanently"); // ADDED
header('Location: '.$this->page_link($this->page['link']).'?'.$_SERVER['QUERY_STRING'].'&lang='.$this->page['language']);
} else {
header("HTTP/1.1 301 Moved Permanently"); // ADDED
header('Location: '.$this->page_link($this->page['link']).'?lang='.$this->page['language']);
}
exit();
}

Like this pages return a 200 OK status.

Some checkers:
https://monitorbacklinks.com/seo-tools/http-header-status-check (https://monitorbacklinks.com/seo-tools/http-header-status-check)
http://www.redirect-checker.org/index.php (http://www.redirect-checker.org/index.php)


Cheerz,

Tez Oner
Title: Re: 302 Language Redirect SEO issue
Post by: Luisehahne on February 12, 2016, 11:26:38 AM
Tks. Fixed in coming WB283 SP6

Dietmar
Title: Re: 302 Language Redirect SEO issue
Post by: Tez Oner on February 12, 2016, 05:14:48 PM
Tks. Fixed in coming WB283 SP6

Dietmar

Cool.

Cheerz,

Tez Oner