• We want to setup a website for a client that will work with 2 different domains using domain aliasing technology. However, when the user visits from one domain we want him to visit a specific homepage and when he visits from the other domain to visit another specific homepage. The rest of the pages, should be accessed via aliasing normally, meaning via both domains.

    How can we do this? We are using Siteground server.

    Thank you.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Unless you dynamically define the home and site URLs, WP will always redirect alias requests back to the domain defined in settings. To dynamically define the site URL, see this section of “Editing wp-config.php”. Do something similar for the home URL as shown in the subsequent section.

    You can alter which page is displayed as a home page through the “pre_get_posts” action. Based on the value assigned to WP_SITEURL constant, assign a particular page ID to the “p” query var. Only do so if is_home() or is_front_page() returns true.

Viewing 1 replies (of 1 total)

The topic ‘Domain Aliasing’ is closed to new replies.