[wp-trac] [WordPress Trac] #21573: NOBLOGREDIRECT interfering with 404 errors
WordPress Trac
noreply at wordpress.org
Fri Aug 30 02:39:23 UTC 2013
#21573: NOBLOGREDIRECT interfering with 404 errors
--------------------------+-----------------------------
Reporter: bungeshea | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Multisite | Version: 3.4.1
Severity: normal | Resolution:
Keywords: has-patch |
--------------------------+-----------------------------
Changes (by jeremyfelt):
* milestone: Awaiting Review => Future Release
Comment:
In a nutshell, from this ticket and #13689, with NOBLOGREDIRECT defined...
If I have `/test/` setup as a subfolder site at `mydomain.com`:
1. `http://mydomain.com/test/` works
1. `http://mydomain.com/test/notapageurl/`, or any non existent URL on the
subfolder site, gives me a `/test/` 404
1. `http://mydomain.com/anythingotherthantest/`, or any non existent URL
on the main site, redirects to the URL specified in NOBLOGREDIRECT
If I have `test.mydomain.com` setup as a subdomain site:
1. `http://test.mydomain.com` works
1. `http://test.mydomain.com/notapage`, or any non existent URL on the
subdomain site, gives me a `test.mydomain.com` 404
1. `http://notsubdomain.mydomain.com` redirects to the URL specified in
NOBLOGREDIRECT
1. `http://mydomain.com/notapage`, redirects to the URL specified in
NOBLOGREDIRECT
It's that last item, where a 404 belonging to the primary site redirects
to NOBLOGREDIRECT in a subdomain install, that is at the heart of the
issue here. I would agree that this seems like unexpected behavior, though
it appears like it has always been the behavior.
The current logic in `maybe_redirect_404()` checks for `is_main_site()`,
but as stated earlier in this ticket and in the other, should probably
look at `is_subdomain_install()` as subdomains are much easier to
determine intent with when trying to guess if dealing with a missing site
or a missing page.
[attachment:21573.2.diff] is a slight variance from the patch uploaded by
bungeshea and adds `! is_subdomain_install()` to the check before
redirecting.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21573#comment:15>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list