WordPress.org

Forums

Multisite with www prefix, domain mapping (4 posts)

  1. ChangJuPark
    Member
    Posted 1 year ago #

    I have multisite wordpress using subdirectory system.

    for instance, my site root domain is abcd.com, my wp-config is ..

    define('WP_ALLOW_MULTISITE', true); define('MULTISITE',true);
    define('SUBDOMAIN_INSTALL',false);
    define('DOMAIN_CURRENT_SITE','abcd.com');
    define('PATH_CURRENT_SITE','/'); define('SITE_ID_CURRENT_SITE',1);
    define('BLOG_ID_CURRENT_SITE',1);

    I connect to http://www.abcd.com but browser's address bar has abcd.com. not http://www.abcd.com

    I need www. prefix, so I change DOMAIN_CURRENT_SITE 'abcd.com' to 'www.abcd.com'. but working root page broken all links (connect link -> redirect to root page)

    my .httaccess

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) 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).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    <IfModule mod_url.c>
    ServerEncoding UTF-8
    ClientEncoding EUC-KR
    </IfModule>

    And Second problem is domain name too.

    first site's domain name is abcd.com/ , second abcd.com/site2

    abcd.com/ using this domain name

    and site2 using http://www.site2.com good working all links are working perfectly.

    but still link's url is abcd.com/site2/somthing

    I want to change abcd.com/site2/somthing to http://www.site2.com/something

    What can I do?

  2. Why do you NEED www?

    As long as it redirects, what does it matter?

    (Using www with WP Multisite is not recommended)

  3. swinggraphics
    Member
    Posted 10 months ago #

    I can't speak for OP, but the reason the sites I build need www is to work with CloudFlare in cPanel.

Topic Closed

This topic has been closed to new replies.

About this Topic