How to redirect to www? #1214
Replies: 7 comments 5 replies
-
By default, Kamal Proxy routes requests only to matching hosts and does not currently support redirection. However, you can achieve this functionality as such:
|
Beta Was this translation helpful? Give feedback.
-
Okay so then my app responds on both hosts and I guess I just redirect in my application controller? |
Beta Was this translation helpful? Give feedback.
-
Okay thanks for your help. That's too bad that Kamal Proxy doesn't handle something as basic as a redirect to www. |
Beta Was this translation helpful? Give feedback.
-
I've been looking for this as well, kind of like what we would do in Apache .htaccess If I was to look at adding this in would there be appetite for this feature? |
Beta Was this translation helpful? Give feedback.
-
Redirects shouldn’t be a concern of Kamal 2. These are better handled by DNS, a reverse proxy, or the app itself, depending on the use case. |
Beta Was this translation helpful? Give feedback.
-
Of those 3 options, I think option 2 is best. Not all DNS providers offer redirection. Checking the host and redirecting at the app level means every request takes a small performance hit. So that leaves number two— which when using Kamal 2 is kamal-proxy. So I believe this should be the role of kamal-proxy (but it currently doesn’t offer this feature).On Nov 24, 2024, at 10:42 AM, Viktor Schmidt ***@***.***> wrote:
Redirects shouldn’t be a concern of Kamal 2. These are better handled by DNS, a reverse proxy, or the app itself, depending on the use case.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
The only way to use |
Beta Was this translation helpful? Give feedback.
-
I've got Kamal 2 working great and deploying my app to www.example.com. But if a user directly navigates to example.com without "www", they hit an ugly "connection is not secure" error message. How can I get Kamal Proxy to do what (in my humble opinion) it should already be doing by default?
Beta Was this translation helpful? Give feedback.
All reactions