301 Redirect - how to set it up?
Hi there,
quick context: I've deployed my dash app with Railway and I've set up on Namecheap a 301 redirect from @ to www version of the site.
In railway, I've two custom domains. xxxx.com and www.xxxx.com .
The redirect I've set up in Namecheap doesn't seem to work.
Is it because the redirect needs to be actually set up in Railway? how to do so?
Solution:Jump to solution
GitHub
GitHub - brody192/domain-redirect-template
Contribute to brody192/domain-redirect-template development by creating an account on GitHub.
13 Replies
Project ID:
80fbd5c7-d9ed-48ff-b158-c17bad8043e2
80fbd5c7-d9ed-48ff-b158-c17bad8043e2 projectID
the redirect is something you would need to setup at the dns level (i dont think namecheap's redirect is sufficient) or something you would need to do in your app itself
I actually spoke with Namecheap. They only support 301 redirect between http but not https. The https redirect needs to be done via server.
Any idea how can I do it via Railway?
you would need to do in your app itselflikely with a middleware
Solution
GitHub
GitHub - brody192/domain-redirect-template
Contribute to brody192/domain-redirect-template development by creating an account on GitHub.
thats a little more complex than what you need
I'm not super knowledgeable but if I deploy it and point with custom domain @ my domain, then the caddy service will do the redirect for me though no?
what kind of app are you running?
plotly dash app
does that framework not provide you with a way to add a middleware to all incoming requests?
nope but I actually achieved what I needed thanks to your service.
I've simply deployed the caddy service on the non www domain and the redirect is set to go to www.mydomain. It's doing what I need by doing a curl, I receive a 301
okay perfect