Caddy v2.2.1, on Linux Debian 9 (Stretch), using Caddyfile config
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace the line below with your
# domain name.
www.metalchain.ca {
redir https://metalchain.ca{uri}
}
metalchain.ca {
redir /solarion https://youtube.com/watch?v=v8vR9Di_ITs
redir /twitch https://twitch.tv/MetalChain_
redir /twitter https://twitter.com/_MetalChain
redir /donate https://ko-fi.com/MetalChain
redir /home https://metalchain.ca
}
# Set this path to your site's directory.
root * /var/www/html
# Enable the static file server.
file_server
# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile
Now, as you can see from my Caddyfile I’m attempting to do multiple redirects, specified by path. The first one in the order works (/solarion), yet the others merely sit on a white page with the same URL in the browser bar.
I’ve tried using redirects by specifying a new site for each redirect (forgive my poor terminology), with the same result.
i.e:
metalchain.ca/solarion {
redir https://youtube.com/watch?v=v8vR9Di_ITs
}
I’ve also tried having an index page in said paths with a meta redirect, but this causes some side-effects with regards to how APIs interpret the redirect (i.e. not at all)
I’m sure there’s some very obvious quirk that I’m missing, but I’ve yet to find the cause/workaround to my issue.
(Also, obligatory thank you, my experience with other webservers have been grueling, and as a beginner, this is a dream come true lol)
EDIT: I’ve also just now noticed that this breaks my main index page lol