Preview and redirect Umbraco Cloud URL
b
It is possible to redirect the default Umbraco Cloud URL to the actual domain, while ignoring redirect on
/umbraco
backoffice URL. https://docs.umbraco.com/umbraco-cloud/set-up/project-settings/manage-hostnames/rewrites-on-cloud However in a multi-site with several domains it cause issues with preview from within backoffice, because in preview frontend in backoffice and the frontend is redirected. This is fine on the actual domain, e.g. mydomain.com and logged in on mydomain.com/umbraco However if logged in on https://project-alias.euwest01.umbraco.io/umbraco and preview it will cause the following error:
Copy code
Refused to display 'https://www.mydomain.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
https://github.com/umbraco/UmbracoDocs/pull/5662 I think .NET Core by default is configured to only allow same origin but it is possible to setup CORS to render content from other domains. It is of course possible to log into backoffice from actual domain, but often content editors have access to edit 10 different sites, so I understand it is simpler to content editors to work from one preferred domain, e.g. the Umbraco Cloud URL or the main domain or just one or the site domains. Are the any recommended way to handle this? Maybe something like this? https://stackoverflow.com/a/31942128 https://www.bytehide.com/blog/cors-aspnet-core
Alternatively maybe https://github.com/andrewlock/NetEscapades.AspNetCore.SecurityHeaders to configure security headers?
It would be great if there's a best practise how to handle this as we typically want to redirect Umbraco Cloud URL after launch, but with a multi-site solution it would be great to be able to preview from same domain (or from
/umbraco
at Umbraco Cloud URL) for each site.
8 Views