Today I moved back my main homepage to GitLab Pages. It just makes it easier to maintain, as it”s just static files in the end.
Previously, using Caddy, I was using the following to redirect the Matrix .well-known endpoints of my server to the correct ones:
your-server.com {
@matrixWellKnown path /.well-known/matrix/*
header @matrixWellKnown Access-Control-Allow-Origin "*"
redir @matrixWellKnown https://matrix.your-server.com{uri} 301
}JSONDoing the same on GitLab Pages is easy. For instance, my website resides in the src folder of the repository. For this, I would just have to create a new file src/_redirects filled with:
/.well-known/matrix/* https://matrix.your-server.com/.well-known/matrix/:splat 301JSONAnd done, looking at the federation tester, everything works as expected. That easy!
Leave a Reply