Domains with different endings, pointing to the same wordpress hosting

Asked

Viewed 87 times

0

People have the following problem I have the following domains for eg: www.meusite.com.br and www.meusite.com, and Wordpress has been configured to use the '.com' domain as the main one. The two domains point to the same DNS, and the site is opening on both domains, but when I click on some internal link, be it a news or page it always opens by the domain url. with'. It would be like this to become dynamic??

2 answers

2

You just need to edit yours config.php where is:

define( 'WP_SITEURL', 'http://meusite.com/wordpress' );

swap for:

define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/wordpress' );

This way Wordpress will dynamically pick up which host it is on.

And if there ever is, too :

define( 'WP_HOME', 'http://meusite.com/wordpress' );

will have to do the same.

NOTE:

I think the ideal is for you to really keep one as the main domain (which you want your site to be known for) and use the other just as parked domain most websites use this approach and I don’t see a practical reason to keep the way the user found the site.

1


Matthew, it’s not recommending doing this. It’s right for you to have a lead and follow it with the links. Why? Google doesn’t like duplicate content and this way it will understand how two sites with the same content.

The right way to do it is to redirect one domain to the other.

Hugs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.