use 302 redirects by default, explicitely specify 301 where really needed
This commit is contained in:
parent
8ea3807f4b
commit
34b7980587
@ -2,9 +2,8 @@
|
||||
|
||||
class RedirectResponse extends Response {
|
||||
|
||||
public function __construct(string $url) {
|
||||
parent::__construct(301);
|
||||
$this->addHeader('HTTP/1.1 301 Moved Permanently');
|
||||
public function __construct(string $url, int $code = 302) {
|
||||
parent::__construct($code);
|
||||
$this->addHeader('Location: '.$url);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class Auto extends RequestHandler {
|
||||
public function get(): Response {
|
||||
list($name) = $this->input('name');
|
||||
if ($name == 'coreboot-mba51-flashing')
|
||||
return new RedirectResponse('/coreboot-mba52-flashing/');
|
||||
return new RedirectResponse('/coreboot-mba52-flashing/', 301);
|
||||
|
||||
if (is_numeric($name)) {
|
||||
$post = posts::get((int)$name);
|
||||
|
@ -5,7 +5,7 @@ namespace handler\main;
|
||||
class ProjectsHtml extends \RequestHandler {
|
||||
|
||||
public function get(): \Response {
|
||||
return new \RedirectResponse('/projects/');
|
||||
return new \RedirectResponse('/projects/', 301);
|
||||
}
|
||||
|
||||
}
|
@ -52,6 +52,4 @@ class admin {
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user