WordPress.org

Ready to get started?Download WordPress

Forums

WordPress w/ Plesk: blank screen without www (2 posts)

  1. istarnet
    Member
    Posted 2 years ago #

    I'm transferring a multisite imstallation to a Plesk VPS. This is my first experience with Plesk (don't make me talk about it!) and I have almost everything working except for two related problems. I am trying to use "www" in my domain name and the address http://www.mydomain.com works fine. Without the www, I get a dreaded blank screen. The next related problem has to do with network admin. I can login the dashboard for the main site using http://www.mydomain.com/wp-admin. However, when I choose the Network admin link, I am taken to http://mydomain.com/wp-admin/network (note the missing www subdomain) which doesn't work because of the first problem. Bottom line is that I cannot admin the network.

    I've tried to add rewrite rules in .htaccess to add the www subdomain to all urls but this has not worked. (I've tried about every conceivable version of the rule.)

    This site contains a mix of real and virtual subdomains. Because this is a Plesk server, I've struggled to get multisite working at all. I have a CNAME wildcard record:

    *.mydomain.com     CNAME www.mydomain.com
    www.mydomain.com   CNAME mydomain.com
    real1.mydomain.com A     123.456.789.123
    mydomain.com       A     123.456.789.123

    I've played around with all variations of CNAME and A records for the real and virtual subdomains. The above is the current configuration for better or worse.

    I struggled with apache configuration because Plesk insists on doing it own thing with the order in which domains are resolved. Because I have non-virtual (real?) subdomains, I could not a generic DomainAlias directive to my vhost.conf file without breaking the real subdomains. Instead, I have added a DomainAlias directive for each virtual subdomain, such as

    # cat /var/www/vhosts/mydomain.com/conf/vhost.conf
    ServerAlias virtual1.mydomain.com
    ServerAlias virtual2.mydomain.com

    This configuration allows all subdomains, including real1.mydomain.com and virtual1.mydomain.com, to be processed correctly.

    Last but not least, I *think* that I have correctly set up WordPress to use the www subdomain for the main site. Just to be sure, I added three directives to wp-config.php

    define( 'WP_HOME', 'http://www.mydomain.com' );
    define( 'WP_SITEURL', 'http://www.mydomain.com' );
    define( 'COOKIE_DOMAIN', 'www.mydomain.com' );

    Have I left anything out? Here is the current contents of .htaccess:

    # 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
    
    # BEGIN FORCE WWW
    RewriteCond %{HTTP_HOST}   ^mydomain\.com$ [NC]
    RewriteRule ^/(.*)         http://www.mydomain.com/$1 [L,R]
    # END FORCE WWW

    Again, I am looking to abandon access to the site without the www subdomain. I'd be happy if I could force www into all requests, including the link on the dashboard to enter network admin. At this time, when I visit http://www.mydomain.com/wp-admin/network, I am redirected to the blank page at http://mydomain.com/wp-admin/network.

    Thanks in advance for any help.

  2. istarnet
    Member
    Posted 2 years ago #

    Simple fix for Network admin. I wrongly stated the value of DOMAIN-CURRENT_SITE in the network configuration in wp_config.php. It should be:

    define( 'DOMAIN_CURRENT_SITE', 'www.mydomain.com' );

    Now my only remaining problems is getting the URL without www to redirect to the domain including www.

Topic Closed

This topic has been closed to new replies.

About this Topic