Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Link to different websites based on which domain you are currently on.

Vote:
 

I am using a multi-site CMS 12 solution, which has 3 different domains configured in the Manage Websites section all using the same folder structure and content. 
I'll call them
qa1.OptimizelySite.com
qa2.OptimizelySite.com
qa3.OptimizelySite.com
I also have other applications that share a similar environment setup with 3 QA sites configured. 
qa1.WordpressSite.com
qa2.WordpressSite.com
qa3.WordpressSite.com
If the user is browsing on qa1.OptimizelySite.com, I want a LinkItem or Url property that directs to the Wordpress Site to go to qa1.WordpressSite.com. Similarly if they are on qa3.Optimizelysite.com i want them to be directed to qa3.WordpressSite.com
What is the best way to achieve this?

#299755
Apr 08, 2023 14:54
Vote:
 

Sounds like you need to write a custom htmlhelper to house your rewriting logic.

#299790
Apr 09, 2023 11:24
Vote:
 

Thanks Surjit. Do you have any links to a solution with similar rewrite logic?

#299924
Apr 11, 2023 15:32
Vote:
 

Take a look at the extension method Url.ContentUrl, you could write your own version of it and have your rewrite logic in there. I believe there's two version of it, one for ContentReferences and the other for the Url property.

#299959
Apr 11, 2023 23:14
* 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.