This repository was archived by the owner on Dec 20, 2024. It is now read-only.
Repository navigation
Url rewrite for staging and production app #3318
Replies: 1 comment 6 replies
|
Hey @BazzoKelesh. You could use Middleware to set up dynamic rewrites using |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Hi,
I have 3 Vercel hosted apps:
This is working as expected of course. But my goal is to access the SvelteKit app paths example 'app.example.com/login' on 'example.com/login' using rewrites. I implemented this inside the vercel.json of the marketing site project and it's working as expected, but only for the production one. Because the rewrite destination currently is just to app.example.com/login, including some other rewrites for different paths. I want the same behaviour for the preview one, so when accessing staging.example.com/login it needs to rewrite to app.staging.example.com/login. I tried to access env variables inside the vercel.json to get my APP_BASE_URL but I can't get it inside the vercel.json using ${ENV_NAME}. Is there another way to achieve this? Different vercel.json files depending on environment will also work for me. Or something else?
Because this is only for the staging one, it's not really a big issue, but I still want a fix. In anyway, I want to also disallow people from accessing the app directly on app.example.com.
2 things I need help with:
Appreciate any help. Thanks!
Example
No response
Steps to Reproduce
I don't have anything to reproduce the issue. Please let me know if you need further details. Thanks!
All reactions