Opened 10 months ago
Last modified 2 months ago
#21573 new defect (bug)
NOBLOGREDIRECT interfering with 404 errors
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Multisite | Version: | 3.4.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
When the NOBLOGREDIRECT constant is defined, 404 pages on the main site will not work and instead redirect to URL defined in NOBLOGREDIRECT. This is the cause of the maybe_redirect_404 action/function, which is not needed and should be removed.
Attachments (1)
Change History (14)
comment:1
SergeyBiryukov
— 10 months ago
comment:2
Frumph
— 10 months ago
Post about subject here: http://frumph.net/2010/06/05/wordpress-3-0-multisite-subdomain-installation-noblogredirect-behavior-fix/
Includes simple behavior fix.
comment:3
bungeshea
— 10 months ago
It seems that the main purpose of this function was intended for sub-directory installs; it should be modified to first check if a subdomain install is active and, if so, bail early.
comment:4
ottok
— 2 months ago
This bug seems to be a very long standing one. Here is a fix from 2010: http://frumph.net/2010/06/05/wordpress-3-0-multisite-subdomain-installation-noblogredirect-behavior-fix/
comment:5
bungeshea
— 2 months ago
@ottok I have applied the fix to my own site (@Fruumph actually posted that same link above), but I thought a fix should be implemented into core.
comment:7
Frumph
— 2 months ago
@bungeshea what about those people who would want to use the define on subdomain installs?
validsubdomain.domain.com/notvalidsuffix/ this needs to redirect to error page
notvalidsubdomain.domain.com/ this needs to be able to use the define
comment:8
bungeshea
— 2 months ago
@Frumph I'm actually testing this code on my own site, and the behaviour is the same as when using the fix you posted about.
http://notvalidsubdomain.bungeshea.com/ redirects to location defined in NOBLOGREDIRECT (in this case, main site)
http://code-snippets.bungeshea.com/notvalidsuffix/ uses usual 404 error page
comment:9
Frumph
— 2 months ago
Your NOBLOGREDIRECT goes to the root page of the site is what you have it set for?
(re-read your comment)
comment:10
bungeshea
— 2 months ago
So what would you suggest? An option in Network Settings, perhaps?
comment:11
Frumph
— 2 months ago
No, my apologies, if the behavior you state is happening then i'm very cool with the end result.
the 404's going to the appropriate 404 page and the wrong subdomain going to the noblogredirect, that's expected behavior and how it should be. If your fix does that, then cool.
comment:12
bungeshea
— 2 months ago
Yep, that's what it does alright. It just disables the 404-redirect-to-NOBLOGREGIRECT-functionality on the front-end only, and only for subdomain installs (subdirectory installs aren't affected). The wrong-blog-redirect functionality is handled elsewhere.
comment:13
Frumph
— 2 months ago
Cool yeah, expected behavior ftw.
Related: ticket:13689:26