blueberry
Basic Pleskian
When I perform a "curl h t t p : / / talk.plesk.com"
I get:
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
This is the default behavior of nginx for a 301 redirect. The same happens on my websites and I would like to get rid of this HTML body to save bytes and also because it is barely in compliance with the rfc7231
RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content
he server SHOULD generate a Location header field in the response
containing a preferred URI reference for the new permanent URI. The
user agent MAY use the Location field value for automatic
redirection. The server's response payload usually contains a short
hypertext note with a hyperlink to the new URI(s).
As you can see in the default response of nginx there is no <a href="new location">here</a> link. If you do a curl triggering a 301 redirection from apache you will see the response contains a A HREF with the destination URL in it.
I which I could only have the HTTP header fields: curl h t t p : / / talk.plesk.com -I
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Wed, 16 Sep 2020 08:23:13 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://talk.plesk.forum
FYI, if you do "curl http://twitter.com" "curl ht tp://facebook.Com", nothing is going to get returned because twitter and facebook got rid of the HTML body of 301 redirect. They rely on the HTTP header field "location" and the "HTTP/1.1 301 Moved Permanently" in the HTTP header. I think it is great because bots don't spend their time looking in the HTML body of the 301, they directly rely on the location HTTP header field.
so if someone has a solution to get rid of the HTML body generated by the following:
I would be willing to know it.
I get:
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
This is the default behavior of nginx for a 301 redirect. The same happens on my websites and I would like to get rid of this HTML body to save bytes and also because it is barely in compliance with the rfc7231
RFC 7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content
he server SHOULD generate a Location header field in the response
containing a preferred URI reference for the new permanent URI. The
user agent MAY use the Location field value for automatic
redirection. The server's response payload usually contains a short
hypertext note with a hyperlink to the new URI(s).
As you can see in the default response of nginx there is no <a href="new location">here</a> link. If you do a curl triggering a 301 redirection from apache you will see the response contains a A HREF with the destination URL in it.
I which I could only have the HTTP header fields: curl h t t p : / / talk.plesk.com -I
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Wed, 16 Sep 2020 08:23:13 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://talk.plesk.forum
FYI, if you do "curl http://twitter.com" "curl ht tp://facebook.Com", nothing is going to get returned because twitter and facebook got rid of the HTML body of 301 redirect. They rely on the HTTP header field "location" and the "HTTP/1.1 301 Moved Permanently" in the HTTP header. I think it is great because bots don't spend their time looking in the HTML body of the 301, they directly rely on the location HTTP header field.
so if someone has a solution to get rid of the HTML body generated by the following:
I would be willing to know it.