Friday , December 20 2024

How to remove the redirect to the main domain for its aliases in WordPress

For multisites, the case of creating site mirrors that open the contents of the main site is relevant.

By default, all mirrors are redirected to the main domain. To disable it, you need to add two lines at the end of the wp-config.php file:

define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);

If the site works via http, then use http instead of https.

About admin

Hi there! My name is Iryna, I am a web developer from Ukraine. While working on freelance projects I often face different technical issues and in this blog I publish articles on how to solve them. I am also interested in digital drawing and in this blog you will find brief tutorials that helped me and hopefully can help you as well.

Check Also

How to remove 404 //fonts.gstatic.com and //fonts.googleapis.com from WordPress head section

I tried solutions with functions that should remove from head and , but a very …

Leave a Reply

Your email address will not be published. Required fields are marked *