[wp-trac] [WordPress Trac] #13909: Redirect does not return a HTTP body
WordPress Trac
wp-trac at lists.automattic.com
Tue Jun 15 19:15:37 UTC 2010
#13909: Redirect does not return a HTTP body
--------------------------+-------------------------------------------------
Reporter: hakre | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.1
Component: General | Version:
Severity: normal | Keywords: has-patch
--------------------------+-------------------------------------------------
When !WordPress redirects via the API ({{{wp_redirect}}}), a useragent
which does not automatically redirect (e.g. configuration because of
usability or security considerations), get's a blank page delivered (which
is of no use for the user). This is because only HTTP headers are set for
the redirect, but not a HTTP body. Normally Webservers and Webapplications
deliver a body as well.
'''Example: Redirect on the google.com domain'''
Command: {{{curl -i http://google.com/}}}
Output:
{{{
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Tue, 15 Jun 2010 18:11:12 GMT
Expires: Thu, 15 Jul 2010 18:11:12 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 1; mode=block
<HTML><HEAD><meta http-equiv="content-type"
content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
}}}
Redirect of google.com to www.google.com; next to the headers a body is
returned (some simple HTML containing the link to the redirected page).
This method is often used as a fall-back for automatic methods — if the
visitor's browser does not support the automatic redirect method, the
visitor can still reach the target document by following the link.
[http://en.wikipedia.org/wiki/URL_redirection#Manual_redirect URL
redirection (From Wikipedia, the free encyclopedia)]
'''Example: Redirect on a wordpress domain'''
This is against a trunk version wordpress setup. I made a setup with a
domain www.webroot.loc and webroot.loc. The blog is w/o the www. so
www.webroot.loc get's redirected to webroot.loc:
Command: {{{curl -i http://www.webroot.loc/wordpress/}}}
Output:
{{{
HTTP/1.1 301 Moved Permanently
Date: Tue, 15 Jun 2010 18:12:38 GMT
Server: Apache
X-Pingback: http://webroot.loc/wordpress/xmlrpc.php
Location: http://webroot.loc/wordpress/
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
}}}
There is no http body in the response.
To increase the overall usability of wordpress a body should returned as
well.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13909>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list