Now more and more people choose Wordpress as their website. Generally speaking, one website corresponds to one domain name, but this is also the case. The company has multiple domains, but only one website. Then how to deal with it. The following is a method for Wordpress to set up access to multiple domains:
1. Open wp-config.php in the root directory of the website, and select define (WP_DEBUG, false); Add the following after:
define(WP_SITEURL, // . $_SERVER[HTTP_HOST]);
define(WP_HOME, // . $_SERVER[HTTP_HOST]);
These two sentences mean that the domain name of the website is set as the domain name currently accessed, that is, the binding of the domain name is cancelled. If you do not need any domain name to access, but only a few domains, you can do this:
$domain = array("www.leiue.com", "www.zhangzifan.com", "www.tearsnow.com");
if(in_array($_SERVER[HTTP_HOST], $domain)){
define(WP_SITEURL, // . $_SERVER[HTTP_HOST]);
define(WP_HOME, // . $_SERVER[HTTP_HOST]);
}
Put the specified domain name in the $domain array.
Note: If it is https, please change the //in the code to //;
If the website is installed in the secondary directory, //$_ SERVER [HTTP_HOST] is modified to //$_ SERVER[HTTP_HOST]./ Corresponding directory name
Open Phoenix News to view more HD pictures
2. After completing the above work, your website can access multiple domains, but there is still a problem, that is, static resources. Pictures uploaded in WordPress are inserted into articles, and the address is fixed. After the domain name is modified, the domain name of the image will not be modified, so you need to modify the static file address, which can be solved by using the following code:
define( WP_CONTENT_URL, /wp-content);
Add this code to the above code.
————————————————————————————————————
SSL certificate is a prerequisite for HTTPS encryption protocol and an encryption channel for secure network transmission. The SSL certificate of the Digital Security Age (GDCA) is an international digital certificate recognized by the international WEB TRUST certification, and is the best choice for upgrading HTTPS. Moreover, GDCA is an international famous brand: GlobalSign, Symantec, GeoTrust SSL certificate domestic gold medal agent. Therefore, the digital security era has a variety of international certificates to meet various users' requirements for SSL. Users can apply to the digital security era for appropriate SSL certificates according to their own needs. The professional team of the digital security era will provide you with the best HTTPS solution.