-
Notifications
You must be signed in to change notification settings - Fork 9
Domain redirects #4921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Domain redirects #4921
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
ac2ed99
add domain as value for the redirects enum
juliawegmayr 4c3de38
add domain as sourceTypeOptions in the redirect form in admin
juliawegmayr 6f5d73d
set placeholder depending on selected source type
juliawegmayr a829f33
add info box if domain is selected
juliawegmayr 37cd8b1
handle domain redirects in middleware
juliawegmayr 9fbd0d2
add changeset
juliawegmayr 6517ee3
add migration guide
juliawegmayr 49b4f97
fix spelling
juliawegmayr 51f4ab3
improve changeset
juliawegmayr ec8db1c
add link to migration guide instead of code example
juliawegmayr 54fc79d
re-add host normalization
juliawegmayr 0431db3
add pagination handling
juliawegmayr 8a04470
create and use getRedirectTargetUrl helper
juliawegmayr 16e2a4c
extract functions for single responsability
juliawegmayr 46f5b06
remove unneccessary type check
juliawegmayr 64d9813
redirect to site's main domain
juliawegmayr 6b811ea
handle news in getRedirectTargetUrl
juliawegmayr fe783d3
add fallback if no redirectSiteConfig is available
juliawegmayr e85fa75
correct message in alert
juliawegmayr f1af8c3
remove protocol from domain and adjust validation of field
juliawegmayr 9f4b3a4
hardcord https
juliawegmayr 91128fb
re-add redirect to main host if no domainRedirectTarget is found
juliawegmayr 329d61e
also redirect to main host, if there is no destination
juliawegmayr 9a4541c
rework migration guide
juliawegmayr b717906
rework migration guide
juliawegmayr 809d049
rework middleware
juliawegmayr 099282e
add sourceType filter in api
juliawegmayr c8568da
apply filter
juliawegmayr 5805ef4
add curly braces to if statement to avoid conflicts with new eslint rule
juliawegmayr 5a1449d
remove destination variable and directly return
juliawegmayr 6ceba14
fix types for filter in redirects util
juliawegmayr 1d6cfcb
remove values suffix from RedirectSourceTypeValuesEnumFilter
juliawegmayr dfcb7b2
rename host to targetBaseUrl
juliawegmayr c5e7c4d
remove else
juliawegmayr 9e89879
improve error message
juliawegmayr 0f7b687
only pass domain to scope in fetchDomainRedirects
juliawegmayr 1d8a170
check for redirect loops
juliawegmayr e22b315
do not use getRedirectTargetUrl function for page.tsx
juliawegmayr da004b5
Merge branch 'next' into domain-redirects
juliawegmayr 64d6c0a
update link to redirectToMainHost in migration guide
juliawegmayr 1fab518
remove getRedirectTargetUrl function and duplicate switch statement i…
juliawegmayr 97587c6
add function getRedirectTargetUrl to redirectToMainHost file with req…
juliawegmayr d22b487
Merge branch 'next' into domain-redirects
juliawegmayr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "@comet/cms-admin": major | ||
| "@comet/cms-api": major | ||
| --- | ||
|
|
||
| Redirects: add `domain` source type | ||
|
|
||
| To fully support domain redirects, additional handling is required in the site middleware. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/api/cms-api/src/mikro-orm/migrations/Migration20251126093305.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { Migration } from "@mikro-orm/migrations"; | ||
|
|
||
| export class Migration20251126093305 extends Migration { | ||
| override async up(): Promise<void> { | ||
| this.addSql(`ALTER TABLE "Redirect" DROP CONSTRAINT IF EXISTS "Redirect_sourceType_check";`); | ||
| this.addSql(`ALTER TABLE "Redirect" ADD CONSTRAINT "Redirect_sourceType_check" CHECK ("sourceType" IN ('path', 'domain'));`); | ||
| } | ||
|
|
||
| override async down(): Promise<void> {} | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.