How to add a redirection for a domain alias which preserves relative paths

HelenaG Grulichova asked on April 13, 2011 13:19

How to add a redirection for a domain alias which preserves relative paths

Correct Answer

HelenaG Grulichova answered on April 13, 2011 13:19

You may need a domain alias redirecting to the main site domain but keeping the domain with relative paths in the URL, for example: domainAlias.com/<any path> will display the content of siteDomainName.com/<the same path>. If so, you can set up the domain alias in Site manager -> Sites -> edit -> Domain aliases -> Redirect URL like: http://domainAlias.com{%relativepath%}.

This approach works since version 5.5 with the 5.5.14 hotfix.
 
-hg-
2 votesVote for this answer Unmark Correct answer

Recent Answers


Chris Worthington answered on April 30, 2014 23:45

That makes perfect sense. Okay, once I set this, how do I synchronize it from my staging server to my production server?

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 2, 2014 01:51

Hello,

I am afraid but in the past customers did not want these changes to be synchronized since it moved the development/testing aliases to production which causes issues and mess. You need to reflect these particular changes manually.

Best regards,
Juraj Ondrus

0 votesVote for this answer Mark as a Correct answer

Ali Naddi answered on June 23, 2014 22:46

Hi, the help file says the opposite of what is written above. It says to use the original domain name in the redirection field. I still have been unable to get either one working in 7.x

Example:

Imagine that the main domain of your website is domain.com and you have domain.co.uk defined as a domain alias with the Redirect URL field set to:

{%protocol%}://domain.com{%relativepath%}

These macros can be used to dynamically redirect users to the correct page under a different domain.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.