amplify-hosting icon indicating copy to clipboard operation
amplify-hosting copied to clipboard

200 Rewrite not working when the source is a subdomain with complete path

Open asumvp opened this issue 3 years ago • 2 comments

Before opening, please confirm:

App Id

No response

Region

No response

Amplify Console feature

Redirects

Describe the bug

200 Rewrite is not working for the following rule.

[
    {
        "source": "https://dev.mydomain.ml",
        "target": "https://anotherdomain.ml",
        "status": "200",
        "condition": null
    }
]

On accessing "https://dev.mydomain.ml" , we do not see rewrite. It just renders the content present on the subdomain. However, 301 and 302 rules works fine.

Expected behavior

On accessing the domain https://dev.mydomain.ml, browser URL bar should show this domain but the content of https://anotherdomain.ml should be rendered.

Reproduction steps

  1. Create a sample application and associate the domain
  2. Use the above mentioned rule

Build Settings

No response

Additional information

No response

asumvp avatar Feb 24 '22 07:02 asumvp

waiting for the resolution

myroslavmail avatar Mar 01 '22 15:03 myroslavmail

Is this an SSR app? This is a known issue with SSR apps.

oliver-leung avatar Jul 23 '22 05:07 oliver-leung

@oliver-leung Is this tracked in another issue anywhere? @myroslavmail did you figure out a workaround for this?

daxiang28 avatar Oct 05 '22 15:10 daxiang28

@daxiang28 no workaround, still an issue

myroslavmail avatar Oct 05 '22 19:10 myroslavmail

@daxiang28 We are tracking this issue internally, but we don't have any new information at the time.

oliver-leung avatar Oct 07 '22 21:10 oliver-leung

Hello @hloriana , thanks for the reply on #3305 . 301 is not a solution for me. I need rewrite, not redirect. The main goal is to be able to soft launch updates on our app to a limited set of countries, so we can monitor bugs and feedback before a global launch. And it must be as transparent as possible for the user, with no changes in url.

Well, my true wish is to be able to do some A/B tests, but I read here #331 that it's not possible atm. It would be awesome if in the future, we could do something like: on a given subdomain, 10% of users use branch newFeature, 90% of people stay on main. Maybe by using Cloudwatch Evidently under the hood ?

Well in the meatime, countries will do, and I'm looking forward for this to get fixed. Will follow this issue. Thank you !

arnriu avatar Feb 16 '23 23:02 arnriu

Yep having same problem. Looking forward to a fix

marksteven avatar Mar 12 '23 13:03 marksteven

Wondering how get this pushed up the priorty list a bit given its been a year. Having the URL write correctly I would have thought would be alot higher than it seems to be ATM. Just a thought. Being able to redirect correctly is paramount to web site working correctly. Might have to look at other options as this does not seem to be progressing since I queried a year ago.

marksteven avatar Apr 03 '23 07:04 marksteven

@hloriii Any update on this issue ? It's been a while...

arnriu avatar Jul 05 '23 09:07 arnriu

Subscribing to this issue. https://repost.aws/questions/QUeSBxa6s4T_GtkfFiTJNxzg/aws-amplify-rewrite-502#ANgGLAgiEoSpyg7_NFirCOWQ

ajiteb avatar Jul 17 '23 08:07 ajiteb