1

Need some help here. Have a WordPress 3.1 install at webtest.mysite.com and want multiple sub-domains at 1.webtest.mysite.com, 2.webtest.mysite.com, etc. After following all the instructions to the letter, every subdomain address redirects to the main install at webtest.mysite.com/wp-signup.php? Any ideas?

.htaccess contents

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
php_value upload_max_filesize 2000M
php_value post_max_size 2000M
php_value memory_limit 2000M
#php_flag display_errors on
  • What's the content of your .htaccess file? Who are you hosting the site with? – curtismchale Apr 4 '11 at 14:48
  • @curtismchale .htaccess contents: 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 php_value upload_max_filesize 2000M php_value post_max_size 2000M php_value memory_limit 2000M #php_flag display_errors on Self hosted on Ubuntu10.04 with apache2 in the /var/www root directory. *.webtest.mysite.com added as ServerAlias in apache config. Thanks! – user4427 Apr 4 '11 at 14:57
  • I put the .htaccess contents into the question to make it easer to read. Please check to make sure they're correct. – John P Bloch Apr 4 '11 at 15:35
  • You might check out my answer here: wordpress.stackexchange.com/questions/3347/… if that fixes it, we should close this as a duplicate. – John P Bloch Apr 4 '11 at 15:37
  • I have added that which takes care of the signup.php redirect and takes users to the main site but I am still unable to reach my subdomains. They all redirect to the main site. – user4427 Apr 4 '11 at 16:03
1

Your .htaccess and wp-config.php seem to be correct as well as your wildcard dns entry.

It looks like the problem is with your apache vhost. You have to include the wildcard entry in your vhost for Multisite to work correctly.

<VirtualHost *:80>
     ServerAdmin admin@mysite.com
     ServerName mysite.com
     ServerAlias www.mysite.com
     ServerAlias *.mysite.com
     UseCanonicalName On
     DocumentRoot /home/mysite/public_html
     ErrorLog /home/mysite/logs/error.log
     CustomLog /home/mysite/logs/access.log combined
</VirtualHost>

If you want to use domain mapping you will need to add a vhost entry for each domain mapped site.

Also make sure you have NameVirtualHost set up in your ports.conf file

NameVirtualHost *:80
Listen 80
  • Thanks! It was the ServerAlias *.mysite.com. However, adding in the UseCanonicalName On broke everything. – user4709 Apr 15 '11 at 23:09
  • You don't need a new virtual host for each domain mapped site, you can simply add a new ServerAlias for each domain. – John P Bloch Apr 28 '11 at 15:08