Implement redirect to www

This commit is contained in:
Daniel Bowling 2021-01-22 20:03:15 -05:00
parent 0a98c13cf8
commit 143a3f3efb

View File

@ -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();