WordPress.org

Ready to get started?Download WordPress

Forums

Multisite (subdirectory) with multiple domains - SITE & HomeURL (2 posts)

  1. michaelvh1
    Member
    Posted 2 years ago #

    Thanks in advance for the help.

    I'm working on migrating a blog, and also setting up new blogs running on AWS (Linux, Apache) multisite sub-directoy install.

    Multisite install is all setup correctly, and functioning, but now we are looking at migrating from running solely on the AWS instance (pointed at it's own service IP) to using rewrite rules from our primary domain.

    Basically, we have a full site and are redirecting the blog directory is AWS:
    http://www.website.com/blog is using rewrite rules to redirect to the AWS instance 23.21.1.1/blogcm/ (blog id 1)
    http://www.website.fr/blog is using rewrite rules to redirect to the AWS instance 23.21.1.1/blogfr (blog id 2)
    http://www.website.de/blog points to the AWS instance 23.21.1.1/blogde (blog id 3)
    .etc

    This works, expect for some issues with Home & Site URL.
    WP_Site remains the AWS server:
    23.21.1.1
    wp_1_options:
    Home URL: 23.21.1.1/blogcm
    Site URL: http://www.website.com/blog
    wp_blogs/blogID 1
    domain: http://www.website.com
    path: /blogcm/

    This functions, with permalinks, BUT, I needed to update the WP-includes link-template.php, taxonomy.php and author-template.php to reference the SiteURL, instead of the HOME URL (as the home URL will continue to write in the AWS server IP address as opposed to the site location). This isn't ideal, as for each WordPress update, I will need to update these WP-includes to ensure that the site URL is still referenced (and not the home URL).

    I know that the Create a Network, and Move WordPress both state to use the same Home / SiteURL - but when I do Permalinks stops to function.
    http://codex.wordpress.org/Create_A_Network

    Setting the home and site URL to match (as told) with standard includes files:
    wp_1_options:
    Home URL: http://www.website.com/blog
    Site URL: http://www.website.com/blog

    Causes the loop to break with 404 page not found for Permalinks (this is really where I'm stuck, and have reverted to modifying WordPress to use SiteURL to fix it). Turning off permalinks, content functions correctly - this is with all plugs disables and the twenty-ten theme.

    I've tried to find the documentation on difference in backend reference to Home and SiteURL but can't find any clarity on what's causing the Home URL update to break permalinks using the same home/siteURL.

    Permalink configuration:

    .htaccess

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?uploads/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    I can't find any documentation online of anyone else running WordPress Mulsite Subdirectories with a different HOME and SITEURL so am curious if I'm completely missing something in my configuration, or if it's unique we're stacking different servers with the rewrite rules directing /blog/ to AWS & WordPress.

    Thanks for your tim! Let me know if I'm missing details to investigate.

  2. michaelvh1
    Member
    Posted 2 years ago #

    wpconfig:

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', '23.21.1.1' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );'

    Permalink config:
    /index.php/%year%/%monthnum%/%day%/%postname%/
    (need to preserve this for the one blog we're migrating)

Topic Closed

This topic has been closed to new replies.

About this Topic