I have wordpress in this domain:
http://www.Dummy.com/en
And want to use second domain such this:
http://www.Dummy2.com
for this wordpress.
How can I redirect Dummy2 to Dummy?
This is some codes that I find out but I couldn't understand them:
wp-config.php
define('WP_SITEURL', ((is_ssl() == true) ? 'https://' : 'http://').$_SERVER['HTTP_HOST']);
define('WP_HOME', ((is_ssl() == true) ? 'https://' : 'http://').$_SERVER['HTTP_HOST']);
It is not a good practice, but:
The best practice is to setup a redirect on a web server side rather than trying to make your website to do so when WordPress doesn't support multiple domains out-of-the-box. Depending on your chosen web server setup there are two answers for you.
1. Apache
You can use the RedirectPermanent directive with a simple VirtualHost, read more here
If only your
Dummy2
website would be configured as a WordPress-based site too then,a ternatively, you can add a redirect rule to.htaccess
inside of your DocumentRoot configured for www.Dummy2.com site.2. IIS
Make sure that you have an URL Rewrite module installed and simply create a new rewrite rule as follows: