Multisites Work actual subdomains being redirected
-
Hi there
This has had both me and my host going around in circles for the last 3 days
I have got ( just updated) WordPress .3 RC3 multisites enabled.
I have added the wildcard *.mysite.com A record.
My host has added the ServerAlias *mysite.com
I have the basic htaccess file in place
I am on a Linux Server using Plesk 9.3
Ok so here goes. I have a couple of actual subdomains which work just fine until my host adds the ServerAlias to the Apache file and then my WordPress multisite works just fine creating and accessing my multiple blogs but when I try and access an actual suddomain it is redirected to this https://www.mysite.com/wp-signup.php?new=mysubdomain.mysite.com
Removing the server alias and my WordPress stops working and my subdomains are fine
Any will help will be greatly appreciated
BradCopy of my htaccess
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]
-
To avoid conflict with your actual subdomain names
Go to Super Admin > Options – Registration Settings – Banned Names = names of actual subdomains
e.g. if you have actual subdomain sites at site23.yoursite.com, site24.yoursite.com and site25.yoursite.com, include site23 site24 and site25 in list of Banned Names… and tell your host to put the “real” subdomain records above the wildcard record. So apache will look up existing ones first, then use the wildcard if it can’t find it.
Hi – Thank you both for your suggestions I have added my two actual subdomains to the Banned names and my host has also added these subdomains to my Apache config file above the wildcard entry.
Results – absolute no change – I am still being redirected as before
Any further help would be appreciated
Is anyone else using actual and wildcard subdomains successfully ?
Brad
P.s have also updated to the latest buildHi I am still going around in circles with this one and running out of ideas – any help would be greatly appreciated
Bradand my host has also added these subdomains to my Apache config file above the wildcard entry.
Do you have access to the file? Xan they paste the lines somewhere so everyone can read them?
Yes, lots of other people have done this successfully. ??
Hi Just waiting for the code to come through and will post it
Excuse my ignorance again but could it have something to do with the www. My main site is called https://www.mysite.com in the WordPress panel and under options the recommended network admin email address is [email protected]
My config file has my site listed as https://www.mysite.comThanks
BradWPMU never did like www, and I don’t know if that’s the same in MS since I prefer no www myself ??
Having said that …
1) check your database via phpMyAdmin and look for following:
yourprefix_1_options/yourprefix_options and yourprefix_blogs
a) in yourprefix_1_options/yourprefix_options, check option_name of siteurl if it has https://www.yoursite.com then set option_name of home to https://www.yoursite.com
b) in yourprefix_blogs, check if the www is there in url and update if none2) in wp-config.php check/correct site URL
define('DOMAIN_CURRENT_SITE', 'yoursite.com' );
to
define('DOMAIN_CURRENT_SITE', 'www.yoursite.com' );
… WRONG – define(‘DOMAIN_CURRENT_SITE’, ‘https://www.yoursite.com’ );
Ok so I have now done a new install on a test site (same host) to deal with the www. issue which now proves that is not an issue at all
Hi Please find a copy of the code below
Iv’e been told that –
This lives external to the core config within a separate vhost.conf[root@myhosting conf]# cat vhost.conf ServerAlias *.mysite.com
This is the way Plesk implements bespoke configurations. You will see the include for vhost.conf at the bottom of the main configuration file. – Also mentioned by my host –
Thanks
BradAnd here is the actual file
# ATTENTION! # DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK # FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM # MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE # FOLLOWING FILE(S): # /var/www/vhosts/mysite.com/conf/vhost.conf # /var/www/vhosts/mysite.com/conf/vhost_ssl.conf # /var/www/vhosts/mysite.com/subdomains/<subdomain-name>/conf/vhost.conf <IfModule mod_ssl.c> <VirtualHost 10.10.10.101:443> ServerName mysite.com:443 ServerAlias www.mysite.com UseCanonicalName Off SuexecUserGroup me123 psacln ServerAdmin [email protected] DocumentRoot /var/www/vhosts/mysite.com/httpdocs CustomLog /var/www/vhosts/mysite.com/statistics/logs/access_ssl_log plesklog ErrorLog /var/www/vhosts/mysite.com/statistics/logs/error_log <IfModule mod_userdir.c> UserDir /var/www/vhosts/mysite.com/web_users </IfModule> ScriptAlias /cgi-bin/ /var/www/vhosts/mysite.com/cgi-bin/ Alias /plesk-stat /var/www/vhosts/mysite.com/statistics/ <Location /plesk-stat/> Options +Indexes </Location> <Location /plesk-stat/logs/> Require valid-user </Location> Alias /webstat /var/www/vhosts/mysite.com/statistics/webstat Alias /webstat-ssl /var/www/vhosts/mysite.com/statistics/webstat-ssl Alias /ftpstat /var/www/vhosts/mysite.com/statistics/ftpstat Alias /anon_ftpstat /var/www/vhosts/mysite.com/statistics/anon_ftpstat Alias /awstats-icon /var/www/html/awstats/icon SSLEngine on SSLVerifyClient none SSLCertificateFile /usr/local/psa/var/certificates/certBde8111 <Directory /var/www/vhosts/mysite.com/httpdocs> <IfModule mod_perl.c> <Files ~ (\.pl$)> SetHandler perl-script PerlHandler ModPerl::Registry Options ExecCGI allow from all PerlSendHeader On </Files> </IfModule> <IfModule sapi_apache2.c> php_admin_flag engine on php_admin_flag safe_mode off php_admin_value open_basedir "/var/www/vhosts/mysite.com/httpdocs:/tmp" </IfModule> <IfModule mod_php5.c> php_admin_flag engine on php_admin_flag safe_mode off php_admin_value open_basedir "/var/www/vhosts/mysite.com/httpdocs:/tmp" </IfModule> <IfModule mod_fcgid.c> <Files ~ (\.fcgi)> SetHandler fcgid-script Options +FollowSymLinks +ExecCGI </Files> </IfModule> SSLRequireSSL Options +Includes +ExecCGI </Directory> <Directory /var/www/vhosts/mysite.com/web_users> <IfModule sapi_apache2.c> php_admin_flag engine off </IfModule> <IfModule mod_php5.c> php_admin_flag engine off </IfModule> </Directory> </VirtualHost> </IfModule> <VirtualHost 10.10.10.101:80> ServerName mysite.com:80 ServerAlias www.mysite.com UseCanonicalName Off SuexecUserGroup me123 psacln ServerAdmin "[email protected]" DocumentRoot /var/www/vhosts/mysite.com/httpdocs CustomLog /var/www/vhosts/mysite.com/statistics/logs/access_log plesklog ErrorLog /var/www/vhosts/mysite.com/statistics/logs/error_log <IfModule mod_userdir.c> UserDir /var/www/vhosts/mysite.com/web_users </IfModule> ScriptAlias /cgi-bin/ /var/www/vhosts/mysite.com/cgi-bin/ Redirect permanent /plesk-stat https://mysite.com/plesk-stat Redirect permanent /webstat https://mysite.com/webstat Redirect permanent /webstat-ssl https://mysite.com/webstat-ssl Redirect permanent /ftpstat https://mysite.com/ftpstat Redirect permanent /anon_ftpstat https://mysite.com/anon_ftpstat Redirect permanent /awstats-icon https://mysite.com/awstats-icon <IfModule mod_ssl.c> SSLEngine off </IfModule> <Directory /var/www/vhosts/mysite.com/httpdocs> <IfModule mod_perl.c> <Files ~ (\.pl$)> SetHandler perl-script PerlHandler ModPerl::Registry Options ExecCGI allow from all PerlSendHeader On </Files> </IfModule> <IfModule sapi_apache2.c> php_admin_flag engine on php_admin_flag safe_mode off php_admin_value open_basedir "/var/www/vhosts/mysite.com/httpdocs:/tmp" </IfModule> <IfModule mod_php5.c> php_admin_flag engine on php_admin_flag safe_mode off php_admin_value open_basedir "/var/www/vhosts/mysite.com/httpdocs:/tmp" </IfModule> <IfModule mod_fcgid.c> <Files ~ (\.fcgi)> SetHandler fcgid-script Options +FollowSymLinks +ExecCGI </Files> </IfModule> Options +Includes +ExecCGI </Directory> <Directory /var/www/vhosts/mysite.com/web_users> <IfModule sapi_apache2.c> php_admin_flag engine off </IfModule> <IfModule mod_php5.c> php_admin_flag engine off </IfModule> </Directory> Include /var/www/vhosts/mysite.com/conf/vhost.conf </VirtualHost> <VirtualHost 10.10.10.101:80> ServerName 1helpdesk.mysite.com:80 SuexecUserGroup me123 psacln ServerAdmin "[email protected]" DocumentRoot /var/www/vhosts/mysite.com/subdomains/1helpdesk/httpdocs CustomLog /var/www/vhosts/mysite.com/statistics/logs/access_log plesklog ErrorLog /var/www/vhosts/mysite.com/statistics/logs/error_log ScriptAlias /cgi-bin/ /var/www/vhosts/mysite.com/subdomains/1helpdesk/cgi-bin/ <IfModule mod_ssl.c> SSLEngine off </IfModule> <Directory /var/www/vhosts/mysite.com/subdomains/1helpdesk/httpdocs> <IfModule sapi_apache2.c> php_admin_flag engine on php_admin_flag safe_mode off php_admin_value open_basedir "/var/www/vhosts/mysite.com/subdomains/1helpdesk/httpdocs:/tmp" </IfModule> <IfModule mod_php5.c> php_admin_flag engine on php_admin_flag safe_mode off php_admin_value open_basedir "/var/www/vhosts/mysite.com/subdomains/1helpdesk/httpdocs:/tmp" </IfModule> <IfModule mod_fcgid.c> <Files ~ (\.fcgi)> SetHandler fcgid-script Options +FollowSymLinks +ExecCGI </Files> </IfModule> Options -Includes +ExecCGI </Directory> </VirtualHost>
Hi All
Update
Ok so I have given up on using actual and virtual subdomains through Plesk panel – If you search this forum for plesk problems you will find that many people have had similar problems.
I did however find someone do stated they had found a way around at least using your webmail with virtual subdomains and will include their solution below.
I have not tested this solutionIf you have a Virtual Private Server [VPS] on a CentOS and use Plesk as a control panel and want to add Wildard “*” DNS entry while still maintaining webmail.domain.com, then you have come to the right place.
Throughout the steps, replace domain.com with your actual domain name.
When you add ServerAlias *.domain.com to the vhost.conf file, the already working webmail.domain.com will no longer work, as the wildcard will catch that.
How to add Wildcard “*” DNS entry
In your domain, select DNS Settings
Click Add Record
Select CNAME for Record Type; put * into domain name and domain.com for the canonical name. [You may use A record type too]
Login to PowerPanel [Parallels Power Panel] as root
– click File Manager
– go to / var/ www/ vhosts/ domain.com/ conf/
– there you’ll find httpd.include do not edit this. This is automatically updated by Plesk.
– create/update another file vhost.conf
– enter onlyServerAlias *.domain.com
– do not enter <VirtualHost inside the file. this file will be included inside httpd.include. So that syntax already exists.
To run commands, you can use SSH Client. In PowerPanel, click “SSH Connection” and Login.
– after the creation of vhost.conf file, we need to run the update. run the following. If no error message is displayed, then all is good.
– # /usr/local/psa/admin/bin/websrvmng -av
– whether the vhost.conf was new or not, you will need to reload the Apache configuration:
– # /etc/init.d/httpd reload
If you want, you can restart Apache using the command:
– # /sbin/service httpd restart
Now you have added the Wildcard “*” DNS Entry in both DNS Settings and vhost.conf. Let’s make sure AtMail is working.
How to make AtMail working even after adding Wildcard “*” DNS entry
Click File Manager
– go to / etc/ httpd/ conf.d/
You’ll see a file called
zz_atmail_vhost.conf
This is the AtMail configuration file. Because the filename starts with “zz” it is at the bottom of sort order. It is this order Apache processes the configuration. So we need to put this file just above zz010_psa_httpd.conf [in your server, you may not find exactly this file. You should find something similar to this name].
So I just renamed our zz_atmail_vhost.conf to zz001_atmail_vhost.conf
This put the file just above our zz010_psa_httpd.conf [note: I tried putting atmail_vhost.conf, which put it at the top, but that made viewing received emails impossible]Now you need to restart qmail.
You can restart qmail using Plesk under Server -> Service Management. You can use ’service qmail restart’ on CentOS.Even after this, if you still not able to view received emails, just restart your container [PowerPanel].
This is not necessary but you can rebuild Qmail configuration files using /usr/local/psa/admin/sbin/mchk utility.
Test:
check webmail.domain.com is working [make sure sending, receiving and able to read received emails working]
check your wildcard dns working [that is your dynamic subdomains you may already have working]
check any domain alias you may have working.
check your main domain.com workingAt this stage – after three weeks of going through a parallel process to this thread, my hosts, Plesk, and myself are on the edge of making a press release that WordPress 3.0+ Multisite will not work with Plesk on Unix cloud hosting.
Collectively we have checked and rechecked EVERTHING, reinstalled countless times, even bought additional domain names and set up additional hosting accounts, and NOTHING prevents recurrence of the error reported at the top of the thread – that enabling wildcard subdomains for WP 3.0 disables fixedname subdomains for mail servers etc.
Therefore a plea – if you DO have this working, please post your (anonymised) settings here or create a codex page for how to do it with UNIX and PLESK. (If you’re using cPanel or Linux, please do not jump in – you’ll only cloud the issue).
Gaz
WordPress 3.0+ Multisite will not work with Plesk on Unix cloud hosting.
That seems a bit of a misstatement. At the very worst you mean to say that WP 3.0 MultiSite with subdomains doesn’t work. And even that, I think, is incorrect.
Aren’t you REALLY saying that enabling wildcard subdomains ON A PLESK SEVER disables fixedname subdomains for mail servers etc.
I would imagine this happens if you just added them in any way, without WordPress installed on the box. WordPress isn’t what’s telling the wildcards to supersede the named subdomains, after all. That’s the server. You just tell it ‘Point * at public_html’ and WordPress accepts whatever comes in via the *.
Seems to be a known issue with Plesk 9.
https://forum.parallels.com/showthread.php?p=419522#post419522
and a fix even:
ipstenu
You just tell it ‘Point * at public_html’ and WordPress accepts whatever comes in via the *.
EXACTLY – regardless of what subdomain name is setup in DNS and VHOSTS, then WP 3.0 grabs that subdomain as if it is a sub-blog and either loadfs it or redirects to the blog creation or registration page, regardless of whether or not the subdomain exists as a non WP subdomain or not.
This did NOT happen under WPMU, it only happens under WPMS – we’ve even tried deleting WPMS and installing WPMU directly into the same domain folder in the hosting and WPMU worked perfectly with no other changes at all to the hosting setup or server files.
What is the BIG change in WPMS compared to WPMU? The one that leaps out at me is that for some reason Automattic deprecated the WPMU VHOSTS function in favour of is_multisite() in the wp-config.php settings – I am certain it is related to that now.
Andrea
Seems to be a known issue with Plesk 9.
I am also now getting it on cPanel installs that were working under WPMU and under 3.0, but since 3.0.1 are now exhibiting the same behaviour re: fixed subdomains being redirected to WPMS login or blog creation – this may explain why my personal inbox traffic locally has dropped from 300-500 mails a day down to under 50, and network wide for all local users, from over 2000 a day to under 200.
I cannot even directly access those mailboxes per domain via Plesk or cPanel now – WPMS 3.0.1 has completely banjaxed the mail-based subdomains (hosts) set in DNS and made them inaccessible.
Why did Automattic “fix” something that was not broken?
Gaz
- The topic ‘Multisites Work actual subdomains being redirected’ is closed to new replies.