One WordPress site is bound to multiple domain names

Source: Internet
Author: User
Tags file url wordpress domain
Open the wp-configphp file in the root directory and find [php] require_once (ABSPATH & amp; 39; wp-settingsphp & amp; rsquo;). add the following code before it: [php] $ yovisunhome = & amp; 39; http: & amp; 39; $ _ SERVER open the wp-config.php file under the root directory and find [php] require_once (ABSPATH. 'WP-settings. php '); add the following code before it: [php] $ yovisunhome = 'http ://'. $ _ SERVER ['http _ host']; $ yovisunsiteurl = 'http ://'. $ _ SERVER ['http _ host']; define ('WP _ home', $ yovisunhome); define ('WP _ SITEURL ', $ yovisuns Iteurl); $ _ SERVER ['http _ host'] in PHP is used to obtain the origin domain name. In this way, you can assign values to the WP_HOME and WP_SITEURL variables to bind multiple WordPress domain names. If the website port is non-standard port 80 and wordpress is not in the website root directory. You can refer to the following settings: [php] define ('WP _ home', 'http ://'. $ _ SERVER ['http _ host']. '/wordpres'); define ('WP _ siteurl', 'http ://'. $ _ SERVER ['http _ host']. '/wordpres'); where/wordpress is the directory where wordpress is located. Put the above two ends in front of this configuration document (I am before mysql configuration ). By the way, set the time for clearing the garbage bins: [php] define ('empty_trash_days ', 7); after setting, in the "Settings"-> "general"-the "WordPress address (URL)" and "site address (URL)" options in the background control panel become gray and cannot be edited. To prevent domain name changes from making images and attachments unavailable, in "settings"> "media" on the control panel, set "complete file URL" to "wp-content/uploads" (same as the parameter of "default Upload path "). ). After WordPress 3.5, some frequently used settings are removed or hidden. for example, the background Media sets the page to hide the upload path (upload_path) and file URL (upload_url_path) is hidden. If you want to set these two options, you can refer to the WordPress Tutorial: Customize the upload path and the URL of the generated file, and finally set your own domain name resolution address.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.