Opened 18 years ago
Closed 18 years ago
#6890 closed defect (bug) (fixed)
Canonical redirection broken for empty host in 'home' option
| Reported by: | thenlich | Owned by: | markjaquith |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.6 |
| Component: | General | Version: | 2.5.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
The canonical redirection of the host part (e.g. www.example.com vs example.com) is broken if get_option('home') returns an empty host part. It returns an invalid redirect in this case.
Setting the 'home' option to an empty host name (e. g. '/') is necessary if the blog needs to be reachable from different domains or protocols (HTTP/HTTPS) without redirecting to a particular one, or when the resulting HTML output should be relocatable (not contain protocol nor hostname).
Attachments (1)
Change History (8)
#3
@
18 years ago
Such an option would be useful. It would be even better to (optionally) disable redirection not entirely, but selectively (for scheme:/host/path).
But that is independent from this bug: if siteurl does not contain a hostname, we cannot rewrite to it. But since a redirect needs an absolute URL, we must use the original from the request in this case.
#5
@
18 years ago
- Cc added
This feature is sorely needed by people using wordpress in a development/staging versus live environment where the same config must be used in both places, and so live should not get a development hostname by accident.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This seems to me to be very much an edge case that would be better handled by simply disabling canonical redirection entirely, via a plugin or something.