Try our conversational search powered by Generative AI!

How to manipulate the "View on website" url?

Vote:
 

Hi.

We are building a new site where we use Episerver as a headless CMS. The frontend is a different application alltogether on a different domain. I need to change the "view on website" link in Episerver edit mode to go to a different url, is there a way to modify this link?

kent

#256159
Jun 07, 2021 10:35
Vote:
 

I think you can achieve this by simply adding a redirect in the web.config for the domain and exclude /episerver from it.

#256171
Jun 07, 2021 14:59
Vote:
 

Hello Kent

Its possible to specify edit and primary domains in admin mode. Edit will be used for edit mode only and primary will be the link used for view on website:

David

#256178
Jun 07, 2021 16:26
Kent Roger Felgen - Jun 07, 2021 21:12
That sounds like a very clean solution. Will setting type primary on a host name have any other effects?
Vote:
 

Since you mentioned headless it depends on your implementation but the primary host name type is normally used for URL generation for links etc. This is described in the official documentation: https://webhelp.episerver.com/latest/en/cms-admin/managing-websites.htm as described below:

  • Primary host. A primary host is the preferred host name when generating links between sites or languages (cultures). If no host is defined as primary, the first non-redirected host and non-edit host is used. You can define only one primary host per language plus one primary that is unbound to any language.
#256222
Jun 08, 2021 7:59
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.