WPMU Development Environment

Multisite is meant to be either one or the other, and it’s not meant to be changed. If I were you, I’d move it to a testing domain rather than a subdomain, since you’re going to have to change it back when it’s time to move, and I don’t know what sort of behaviors you’ll … Read more

getting content from main domain to sub-domain using category and WP_Query

What you can do is to set up a pre_get_posts() filter in the subdomains’ theme functions.php file to restrict posts to the desired category… function my_subdomain_category( $query ) { if ( $query->is_main_query() ) { $query->set( ‘cat’, ‘123’ ); // use the categoryID for space or products } } add_action( ‘pre_get_posts’, ‘my_subdomain_category’ );

WildCard SSL with wordpress subdomain

I found a simple plugin that did the job for me. This is what my .htaccess file looks like now for my sub-domain: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} !=on [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] # BEGIN WordPress #RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php … Read more

WordPress Multisite/Network – How to use a subdomain as main blog and subdomain for child sites

There’s a couple of different ways that might work, but both rely on using Apache/NGINX directives. Method 1 Setup WordPress MS at mydomain.com, create an admin.mydomain.com site and then redirect mydomain.com to admin.mydomain.com. All additional sites would naturally be subdomains to mydomain.com. Method 2 This is basically the inverse of Method 1. You should be … Read more

WordPress 404 on Subdomain

You don’t appear to have allowed .htaccess overrides in the <VirtualHost *:443> container, so .htaccess is effectively disabled. Without .htaccess you’ll naturally get 404s for anything other than the homepage if you are using “pretty” permalinks. (.htaccess is not required for requests to the homepage, since index.php is served by mod_dir which is no doubt … Read more

Hard code a domain into Yoast SEO canonical URLs

Below is a small plugin using which you should be able to replace the domain for canonical url to another domain. <?php /* * Plugin Name: WPSE WPSEO Canonical * Plugin URI: http://wordpress.stackexchange.com * Description: Changes canonical url domain. * Author: Sisir * Version: 1.0 * Author URI: http://developerpage.net * **/ add_filter(‘wpseo_canonical’, ‘swpseo_canonical_domain_replace’); function swpseo_canonical_domain_replace($url){ … Read more