Paul Knopf
Paul Knopf

Reputation: 9786

GitHub Pages Jekyll redirects using application/octet-stream as content type

I have implemented redirecting on github pages, but for some reason, your servers are returning a content type of “application/octet-stream” for the redirect pages. This causes the browser to not render the redirect pages, so the resulting javascript can’t execute to actually do the redirect.

How can I get the response headers to have a text/html specified as the content type so the redirects work?

Here is the url.

http://www.pknopf.com/blog/performance-ccli-vs-com

Here is the response.

HTTP/1.1 200 OK
Server: GitHub.com
Content-Type: application/octet-stream
Last-Modified: Sat, 06 Sep 2014 04:30:37 GMT
Expires: Sat, 06 Sep 2014 04:41:33 GMT
Cache-Control: max-age=600
Content-Length: 598
Accept-Ranges: bytes
Date: Sat, 06 Sep 2014 04:40:38 GMT
Via: 1.1 varnish
Age: 545
Connection: keep-alive
X-Served-By: cache-iad2132-IAD
X-Cache: MISS
X-Cache-Hits: 0
X-Timer: S1409978438.779912,VS0,VE2
Vary: Accept-Encoding


      <!DOCTYPE html>
      <meta charset=utf-8>
      <title>Redirecting...</title>
      <link rel=canonical href="http://www.pknopf.com/development/2013/03/07/Performance-CPP-CLI-vs-COM.html">
      <meta http-equiv=refresh content="0; url=http://www.pknopf.com/development/2013/03/07/Performance-CPP-CLI-vs-COM.html">
      <h1>Redirecting...</h1>
      <a href="http://www.pknopf.com/development/2013/03/07/Performance-CPP-CLI-vs-COM.html">Click here if you are not redirected.</a>
      <script>location='http://www.pknopf.com/development/2013/03/07/Performance-CPP-CLI-vs-COM.html'</script>

Upvotes: 3

Views: 555

Answers (1)

David Jacquel
David Jacquel

Reputation: 52829

As seen in jekyll redirect from documentation, redirect urls needs a trailing slash.

In your posts, you MUST add a trailing slash to your redirects.

eg : in _posts/2013-03-07-Performance-CPP-CLI-vs-COM.md

redirect_from: "/blog/performance-ccli-vs-com"

becomes :

redirect_from: "/blog/performance-ccli-vs-com/"

Upvotes: 3

Related Questions