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

@ -3,9 +3,15 @@
use Mojolicious::Lite;
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';
app->start();