• Resolved davidjeanneret

    (@davidjeanneret)


    Hi Folks,

    I’ve set up a subdomain based WordPress Network (with Domain Mapping all sorted I think)
    I chose to leave the Network address as https://www.hostingbydavid.co.uk rather than loose the www, since my other sites associated with that brand are going to have the www.

    Now if I click Visit Network from the Admin Tool bar, of if I visit the HostingByDavid site (the address of which is https://www.hostingbydavid.co.uk) I get instead the https://www.hostingbydavid.co.uk/wp-signup.php?new=hostingbydavid.co.uk page.

    Everything else seems to be working OK (admin control panel and all other pages on the site, e.g. https://www.hostingbydavid.co.uk/web-hosting-services/)

    wp-config.php says:

    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'www.hostingbydavid.co.uk' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    define( 'SUNRISE', 'on' );

    .htaccess says:

    # Switch rewrite engine off in case this was installed under HostPay.
    RewriteEngine Off
    
    SetEnv DEFAULT_PHP_VERSION 53
    
    DirectoryIndex index.cgi index.php
    
    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # END WordPress

    Not sure what’s wrong! any help appreciated.

    Cheers

    David

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    My normal suggestion would be to check if the URL was NOT www and redirect via .htaccess. However. You’re using subdomains, and that would be problematic. So instead, let’s put this ABOVE the WordPress calls in your .htaccess:

    # Redirect non-www urls to www
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com [NC]
    RewriteRule (.*) https://www.example.com/$1 [R=301,L]
    Thread Starter davidjeanneret

    (@davidjeanneret)

    You absolute genius!
    Thank You.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I want my network site to be www.domain.com (rather than without the www)’ is closed to new replies.