roots / multisite-url-fixer

Fixes WordPress issues with home and site URL on multisite when using Bedrock
MIT License
59 stars 19 forks source link

Can't access sites wp-admin other than / when not using subdomains in multisite install #1

Closed ptrckvzn closed 7 years ago

ptrckvzn commented 7 years ago

I usually set up multisite without subdomains and use one site per language :

For main site, wp-admin is accessible at example.com/wp/wp-admin. For the other site, I get to example.com/en/wp/wp-admin and get a Page not found. If I try example.com/en/wp-admin, the admin seems to load, although the page is unstyled (no css).

Someone can reproduce that?

I'd be happy to look for a fix.

JulienMelissas commented 7 years ago

Ah, good point. Thanks for finding this @ptrckvzn! I will admit I only tested on subdomain-based multisites. It will be a while before I can get to look into the other way, just cause I've got a pretty busy week, so any testing or fixes you could do would be great! If not, we might just need to make this plugin subdomain-compatible only for now.

JulienMelissas commented 7 years ago

@ptrckvzn - I was thinking - do we actually even need this plugin for multisites that have subdirectory installs or does everything function without it? Excuse my ignorance and also laziness to spin up a test install 😬

ptrckvzn commented 7 years ago

Ohhh. I think my issue is with .htaccess. 👎 I double-checked and the problem I am having is that a missing / at the end of example.com/wp/wp-admin would redirect me to a not-found page example.com/wp/wp/wp-admin/. Definitely linked to my rewrite rules.

So I tested with and without this plugin and only the network admin gets added /wp/ in its url.

With this plugin (including my "fix"):

network: example.com/wp/wp-admin/network/ site1: example.com/wp/wp-admin/ site2: example.com/en/wp-admin/

Without it:

network: example.com/wp-admin/network/ site1: example.com/wp/wp-admin/ site2: example.com/en/wp-admin/

I'm not sure which is preferable, but in both cases, all admins are accessible...

JulienMelissas commented 7 years ago

@ptrckvzn - thanks for your testing on this!

Your findings are kind of what I was thinking. I prefer the urls with your "fix" (#2), so I'd love to merge that in, but don't want anyone with default WordPress .htaccess to run into this.

I'm going to need to do some testing, which I think I can do this weekend. Would love feedback from others if they want to take a look.

JulienMelissas commented 7 years ago

Closed by #2