WordPress.org

Support

Support » Plugins and Hacks » Map subdomain to subdomain

Map subdomain to subdomain

  • I am working with a WordPress network, network.com (configured to use subdomains) and I am trying to do the following:

    I want to map http://blog.mysite.com to http://mysite.network.com, where http://mysite.com is an external site that I control and http://mysite.network.com is my site on the network.

    I’ve done what I think I’m supposed to do for this—that is to say, added a CNAME record for mysite.com that points blog.mysite.com to mysite.network.com, but instead of loading the specific site on the network to which I’ve mapped it, http://blog.mysite.com sends me to the root site on the network. Any ideas? DNS records are as follows.

    mysite.com

    Host		Records		Details
    
    @			A			11.22.33.44
    *			A			11.22.33.44
    blog		CNAME		mysite.network.com

    network.com

    Host		Records		Details
    
    @			A			55.66.77.88
    *			A			55.66.77.88
    www			CNAME		network.com

    And .htaccess for network.com is as follows.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    # always redirect non-logged-in users on the main site to wp-signup.php
    RewriteRule ^wp-(signup|activate)\.php /wp-content/themes/network-root/.core/wp-$1.php [L,QSA]
    
    # 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]
    
    ### BEGIN ANTISPAMBLOG REGISTRATION
    # RewriteCond %{REQUEST_METHOD} POST
    # RewriteCond %{REQUEST_URI} .wp-signup.php*
    # RewriteCond %{HTTP_REFERER} !.network.com. [OR]
    # RewriteCond %{HTTP_USER_AGENT} ^$
    # RewriteRule (.*) http://network.com/spam-prevention/ [R=301,L]
    ### END ANTISPAMBLOG REGISTRATION
    
    # Disable directory browsing:
    Options -Indexes

    https://wordpress.org/plugins/wordpress-mu-domain-mapping/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Map subdomain to subdomain’ is closed to new replies.