NGINX Multisite Rewrite rules

The Nginx Multisite method outlined below has been tested and will work for subdomain Multisite installs and will also work with the domain mapping plugin. To simplify the process of making future changes the server files are organized into 3 separate files. The first is nginx.conf which holds the basic configuration and tells the server … Read more

Multisite installation combining subdomains and subdirectories

If the subdomains are just for looks and don’t actually impact data. Then have all subdomains point to the same place, install the domain mapping plugin: http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/ That may help. Alternatively you could just setup manual aliases to the main domain and as long as they all point to the exact same spot and you … Read more

Multiple domain names under one WordPress Installation

You need the following: 1) Enable WordPress Multisite in your main domain The Ultimate WordPress Multi Site Network Management Guide (tutorial) Multisite Rationale (case study, tips, tools) 2) Install the plugin WordPress MU Domain Mapping Multisite Domain Mapping Tutorial Here’s a workaround to make Domain Mapping work in GoDaddy and Dreamhost shared hosting (may apply … Read more

multisite htaccess 301 redirects

Okay, RewriteEngine On RewriteBase / # Blog ID1 Rewrite Rules RewriteCond %{HTTP_HOST} ^(www\.)?primary-domain.co.uk [NC] RewriteRule ^about/careers/$ contact/careers/ [R=301,NC,L] RewriteRule ^glossary.html$ sitemap/ [R=301,NC,L] # Blog ID3 Rewrite Rules RewriteCond %{HTTP_HOST} ^(www\.)?mapped-domain3.co.uk [NC] RewriteRule ^about/$ http://primary-domain.co.uk/about/ [R=301,NC,L] RewriteRule ^news/$ http://primary-domain.co.uk/news/ [R=301,NC,L] This works, there’s 158 more lines to my particular site but you get the idea. I … Read more

How does WordPress connect sites and the wp_users table?

On multisite it’s still a single user table for all websites. It identify user relationship with sites on the table wp_usermeta, under the following user meta keys: wp_x_capabilities wp_x_user_level There are other meta keys for user options. But I guess there is no difference on other meta fields (like name, display name and etc), so … Read more

WP REST API – Multisite – get posts from all sites

Here’s a REST API recipe for latest post per site on a multi-site, for relatively few sites: Use get_sites(), loop over sites and switch to each site, query latest post on each site, collect data, order data by utime, serve data Example REST Routes https://example.com/wp-json/wpse/v1/latest-post-per-site https://example.com/wp-json/wpse/v1/latest-post-per-site?number=10 https://example.com/wp-json/wpse/v1/latest-post-per-site?debug Example Plugin Here’s a demo plugin implementing the … Read more

Transfer Subdomain site to Multisite setup

Assuming sd1.mysite.com and sd2.mysite.com are single WordPress installs. You can create mysite.com as a WordPress Multisite, you can then export the posts, users, etc and reimport to the new multisite version of sd1 or sd2 using: https://en-ca.wordpress.org/plugins/wordpress-importer/ You will need to include the themes, plugins as well in the new multisite install. If sd1.mysite.com and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)