Implement redirect to www
This commit is contained in:
parent
0a98c13cf8
commit
143a3f3efb
|
@ -4,8 +4,14 @@ use Mojolicious::Lite;
|
||||||
|
|
||||||
get '/' => sub {
|
get '/' => sub {
|
||||||
my ($c) = @_;
|
my ($c) = @_;
|
||||||
|
my $hostHeader = $c->req->headers->host();
|
||||||
|
|
||||||
$c->render();
|
if ($hostHeader =~ /www.wethepeople.win(|:[0-9]{1,5})/) {
|
||||||
|
$c->render()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$c->redirect_to('http://www.wethepeople.win')
|
||||||
|
}
|
||||||
} => 'index';
|
} => 'index';
|
||||||
|
|
||||||
app->start();
|
app->start();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user