Domains with different endings, pointing to the same hosting in wordpress

0

I have the following problem with the following domains eg: www.meusite.com.br and www.meusite.com, with Wordpress configured to use the '.com' domain as the main domain. Both domains point to the same DNS, and the site is opening in both domains, but when I click on an internal link, whether it is a news or a page it always opens through the .com 'url. Would this have got to be dynamic ??

    
asked by anonymous 14.08.2014 / 20:23

2 answers

1

Matthew is not recommending doing this. The sure thing is you have a principal and follow him with the links. Because? Google does not like duplicate content and this way it will understand how two sites with the same content.

The correct way to do this is to redirect one domain to another.

Hugs

    
20.08.2014 / 16:25
2

You only need to edit your config.php where it is:

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

Switch By:

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

In this way Wordpress dynamically takes over the host on which it is located.

And if by any chance there are:

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

You'll have to do the same.

NOTE:

I think the ideal thing is for you to actually keep one as the main domain (whatever your site is known for) and use the other only as parked domain most sites use this approach and I do not see a practical reason to maintain the way the user found the site.

    
14.08.2014 / 22:03