Wordpress accelerates website access with a second-level domain name for images

Source: Internet
Author: User
Tags install wordpress

Some time ago, a small partner talked in the group about using a second-level domain name to load wordpress website images. There were many such tutorials a long time ago, and Mr. V didn't have to repeat them, however, since wordpress3.5, the options for setting the upload path in the background are no longer available, so let's take a wordpress tutorial here. Add the following code to the topic's functions. Php file:


If (get_option ('upload _ path') = 'WP-content/uploads' | get_option ('upload _ path') = null ){

Update_option ('upload _ path', WP_CONTENT_DIR. '/uploads ');

}


Then go to the multimedia settings page under the Settings option, as shown in the figure below:

 

Then you can see the following options:

 

The default Upload path does not need to be modified. You only need to fill in your second-level domain name in the complete URL of the file, and then log on to the background of the space to direct the domain name to the default Upload path directory. Log on to the domain name background to resolve the domain name to the space, log on to phpmyadmin, select the database to install wordpress, and execute the following SQL query:


UPDATE wp_posts SET post_content = REPLACE (post_content, 'http: // www.111cn.net/uploads/', 'http: // m.111cn.net /');

Replace the data table prefix and domain name in the SQL statement with your own. If you have not modified the default data table prefix, you only need to replace it and execute the SQL statement.

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.