Aliyun Server configures multiple WordPress site methods

Source: Internet
Author: User
Tags aliyun

How to open and build WordPress multi site on Ali Cloud? Build many sites, most of the webmaster will choose to repeat the station, that is, in the same space with WordPress repeated the construction of multiple sites, the advantage is that each site does not interfere. Such a scheme, for the establishment of the station is not much of the situation is still more to test. But if you want to build multiple stations, 10 or even dozens of sites that do not only affect speed in the same space or server, but also consume a lot of system resources (e.g., like many WordPress theme stations, they have to set up a demo station for each theme), This package is a bit of an option. Then, on the Aliyun server how to open and build a WordPress multi-site to solve this situation? Now let's take a look.

The first step: Open wordpress multi-site network configuration.

In the site root directory, add wp-config.php:

Define (' Wp_allow_multisite ', true);

Once set up, we will see a "Configure Network" tool under the Tools menu in the background of the Web site.

Step two: Click to open Network configuration and create a network. (If you do not disable the plugin will prompt you to disable the plugin)

You will be prompted to add the following content to your wp-config.php file (in c:/wamp/www/). Please add in/* That's all, stop editing! Happy blogging. *////* OK! Please do not continue editing. Please save this document. Use Happy! * * Above:

Define (' multisite ', true);
Define (' Subdomain_install ', false);
Define (' domain_current_site ', ' localhost ');
Define (' Path_current_site ', '/');
Define (' Site_id_current_site ', 1);
Define (' Blog_id_current_site ', 1);

Note: First, back up the root directory of your site "wp-config.php" and ". htaccess" files;

Step three: Configure the pseudo static code.

Apache rule: Configure the pseudo static code provided in the Web page by default Apache, which replaces the code in the. htaccess file in the root directory of your Web site directly. As follows:

Rewriteengine on
Rewritebase/
Rewriterule ^index.php$–[l]
# Add a trailing slash to/wp-admin
Rewriterule ^ ([_0-9a-za-z-]+/)? wp-admin$ $1wp-admin/[R=301,l]
Rewritecond%{request_filename}-F [OR]
Rewritecond%{request_filename}-D
Rewriterule ^–[l]
Rewriterule ^ ([_0-9a-za-z-]+/)? (wp-(content|admin|includes). *) $ [L]
Rewriterule ^ ([_0-9a-za-z-]+/)? (. *.php) $ $ [L]
Rewriterule. index.php [L]

Nginx rule: Suppose your site domain name is hero.com, then Nginx rule file is:/alidata/server/nginx-1.2.5/conf/vhosts/hero.com.conf (of course, this hero.com.conf file name is your own, to correspond to the relevant site directory, in the last brace of this file to add the following code:

#ignored: "-" thing used or unknown variable in regex/rew
Rewrite ^/([_0-9a-za-z-]+/)? wp-admin$/$1wp-admin/permanent;
if (-f $request _filename) {
Set $rule _2 1;
}
if (-D $request _filename) {
Set $rule _2 1;
}
if ($rule _2 = "1") {
#ignored: "-" thing used or unknown variable in regex/rew
}
Rewrite ^/([_0-9a-za-z-]+/)? (wp-(content|admin|includes). *)/$2 last;
Rewrite ^/([_0-9a-za-z-]+/)? (. *.php) $/$2 last;
Rewrite/. /index.php last;

Save the file, and then restart the server. In this way, the main site of the WordPress multi-site function is built successfully.
Then, you can at the top of your site backstage to see a My Site--> Management Network menu, this menu has 4 small menu, click on the "Site", you can create your new site in this site page.
If your site is in the virtual space, build more sites, will be more convenient than the Aliyun built.
Note: If it is a subdirectory mode, the main site of the article automatically added to the link/blog/, if you directly in this subdirectory site Settings > Fixed link settings structure, is unable to remove/blog/, and in LNMP environment, direct modification will automatically add index.php.
The solution is to visit all the sites and click on the editors at the main site:

Switch to the "Settings" tab, find a fixed link here, directly fill in the fixed link structure (such as/%postname%.html), save it. This will remove the/bolg/, and will not add index.php, very perfect.

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.