Actions

How to setup a wordpress multisite network

From OpenLiteSpeed Wiki

To create a WordPress multisite network on OpenLiteSpeed.

Set Permalink Settings

Set Permalink Settings to Plain. You can revert back to your original permalink settings afterwards. This step is important, otherwise category pages will return 404 Not Found.

Wp-network0.JPG

Set up the Network

Follow the WordPress guide to setup the network.

Modify Rewrite Rules

In order to work with OpenLiteSpeed, there are slight modifications to the rewrite rules.

For a Sub-domain Network

Access the WebAdmin console, and add wildcard domains to the listener vhost mapping as shown in the screenshots below. *.your-domain, separated by , from the main domain.

Wp-network1.jpg

Also add a wildcard record in the DNS server.

Wp-network2.jpg

Place rewrite rule into .htaccess as follows:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^/ - [L]
RewriteRule ^/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

For a Sub-directories Network

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).*) $2 [L]
RewriteRule ^/([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Note: If a category page in a sub-directory site returns "not found," please change the WordPress Permalink Settings to Plain, save the settings, and then revert back to your original format.

Restart OpenLiteSpeed

Please restart OpenLiteSpeed to make these changes take effect.