Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#24211 closed defect (bug) (worksforme)

WPMU works with example.com but not sub.example.com

Reported by: looimaster's profile Looimaster Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: Multisite Keywords:
Focuses: Cc:

Description

Installtion 1:
I created a WPMU installation on http://example.com/ domain with http://example.com/site/ link structure and it works just fine. Users can register new blogs and they can access them using respective links they chose.

Installtion 2:
I created another WPMU installation on http://test.example.com/ domain with http://test.example.com/site/ link structure and it works just fine. Users can register new blogs and they can access them using respective links they chose.

Installation 3:
I created yet another WPMU installation on http://test2.example.com/ and it works (I can access main theme, Dashboard etc.) but as soon as user registers new site under http://test2.example.com/site/ - it returns 404 not found in admin panel and when I try to view this website. I copied .htaccess etc. correctly, paths are correct. In case of this installation I also redirected this subdomain to another server.

DNS:
test2.example.com - record A - 000.000.000.000 (IP of the second server)

I bet that it generated invalid .htaccess content but I may be wrong.

Change History (3)

#1 @Looimaster
11 years ago

More DNS information:

http://gyazo.com/5041a5bf40c2f320584b2dc00c3a44ac.png

.htaccess generated:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [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]

wp-config.php:

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

#2 @markjaquith
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Went through the same procedure. Got:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [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]

And:

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'blogs.local.dev');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

Created a site named foo. http://blogs.local.dev/foo/ works. All looks good here. I'm guessing there is some other variable at play. Reopen the ticket if you have more information!

#3 @Looimaster
11 years ago

You're right! For some reason my .htaccess had wrong line endings and it was executing 50% of it. I switched them to UNIX style and it started to work. It was tough to discover that but it works!

Note: See TracTickets for help on using tickets.