aws-amplify / aws-amplify/amplify-hosting

Multi domain rewrite to a subpath

Open
#2,966 1 comment 0 reactions 0 assignees View on GitHub
custom-domain question redirects
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked the [custom domains troubleshooting guide](https://docs.aws.amazon.com/amplify/latest/userguide/custom-domain-troubleshoot-guide.html).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### App Id

d5iylbmcud474

### Region

eu-west-1

### Step

Rewrite to a subpath

### Status

not working

### Issue or question

hi,

In My app I have to different domain, and I need to redirect from root of domain to a subpath i.e.
`www.first.domain.com redirect to www.first.domain.com/something`
and
`www.second.domain.com redirect to www.second.domain.com/something-else`

i tried to use rewrite and redirect rules, but the only one that works is this one:
` {
"source": "/",
"target": "/something",
"status": "200",
"condition": null
}
`
but with this rule both domains will be redirected in the same subpath.

is possible to do that?

### Error message

_No response_

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the custom-domain troubleshooting guide and the rewrite/redirect rule configuration described in the issue. Reproduce the behavior for both domains and determine whether host-specific subpath routing is supported; done means documenting the supported configuration or confirming the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.