# Why 307 redirects from http -\> https instead of 301?

**URL:** <https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369>\
**Category:** Meta Elastic\
**Created:** [July 27, 2015, 9:30pm UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369 "2015-07-27T21:30:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![russellsavage](https://avatars.discourse-cdn.com/v4/letter/r/bcef8e/32.png) [@russellsavage](https://discuss.elastic.co/u/russellsavage)\
**Post date:** [July 27, 2015, 9:30pm UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369/1 "2015-07-27T21:30:10Z")

</div>

I'm curious about the decision to use 307 redirects from http -\> https instead of 301. Everything that I've read seems to say that a 307 is a temporary redirect, similar to 302. Why not make those redirects to https permanent (301)? This would tell webcrawers that they can link directly to the https version of the page and avoid the redirect in the future.

Right now, nearly all of our discuss.elastic.co pages have the http version indexed on Google.

Thanks,  
Russ

---

<div class="post-metadata">

**Author:** ![Sam\_Saffron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_saffron/32/44937_2.png) [@Sam\_Saffron](https://discuss.elastic.co/u/Sam_Saffron)\
**Post date:** [July 27, 2015, 10:30pm UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369/2 "2015-07-27T22:30:17Z")

</div>

307 is coming from your browser, we have [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) here, so browser issue the 307 in dev tools, if you use curl it will be a 301.

---

<div class="post-metadata">

**Author:** ![russellsavage](https://avatars.discourse-cdn.com/v4/letter/r/bcef8e/32.png) [@russellsavage](https://discuss.elastic.co/u/russellsavage)\
**Post date:** [July 27, 2015, 10:38pm UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369/3 "2015-07-27T22:38:41Z")

</div>

Using curl, I'm actually seeing a 302 response, not a 301. Is there something I'm missing?

```
~ rsavage$ curl 'http://discuss.elastic.co/c/elasticsearch' -v
* Hostname was NOT found in DNS cache
* Trying 64.62.211.227...
* Connected to discuss.elastic.co (64.62.211.227) port 80 (#0)
> GET /c/elasticsearch HTTP/1.1
> User-Agent: curl/7.37.1
> Host: discuss.elastic.co
> Accept: */*
>
< HTTP/1.1 302 Found
< Cache-Control: no-cache
< Content-length: 0
< Location: https://discuss.elastic.co/c/elasticsearch
< Connection: close
<
* Closing connection 0
```

---

<div class="post-metadata">

**Author:** ![Sam\_Saffron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_saffron/32/44937_2.png) [@Sam\_Saffron](https://discuss.elastic.co/u/Sam_Saffron)\
**Post date:** [July 27, 2015, 10:40pm UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369/4 "2015-07-27T22:40:14Z")

</div>

ahhh .. k yeah we can change that to a 301 in haproxy...

---

<div class="post-metadata">

**Author:** ![Sam\_Saffron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sam_saffron/32/44937_2.png) [@Sam\_Saffron](https://discuss.elastic.co/u/Sam_Saffron)\
**Post date:** [July 28, 2015, 12:57am UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369/5 "2015-07-28T00:57:43Z")

</div>

Cool, fixed it up:

```auto
sam@ubuntu discourse % curl 'http://discuss.elastic.co/c/elasticsearch' -v
* Hostname was NOT found in DNS cache
* Trying 64.62.211.227...
* Connected to discuss.elastic.co (64.62.211.227) port 80 (#0)
> GET /c/elasticsearch HTTP/1.1
> User-Agent: curl/7.35.0
> Host: discuss.elastic.co
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Content-length: 0
< Location: https://discuss.elastic.co/c/elasticsearch
< Connection: close
< 
* Closing connection 0

```

---

<div class="post-metadata">

**Author:** ![russellsavage](https://avatars.discourse-cdn.com/v4/letter/r/bcef8e/32.png) [@russellsavage](https://discuss.elastic.co/u/russellsavage)\
**Post date:** [July 28, 2015, 3:27am UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369/6 "2015-07-28T03:27:13Z")

</div>

Great! Thanks!

---

<div class="post-metadata">

**Author:** ![russellsavage](https://avatars.discourse-cdn.com/v4/letter/r/bcef8e/32.png) [@russellsavage](https://discuss.elastic.co/u/russellsavage)\
**Post date:** [July 28, 2015, 3:27am UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369/7 "2015-07-28T03:27:21Z")

</div>



---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 28, 2015, 9:58pm UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369/8 "2015-07-28T21:58:31Z")

</div>



---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:47pm UTC](https://discuss.elastic.co/t/why-307-redirects-from-http-https-instead-of-301/26369/9 "2017-07-06T13:47:22Z")

</div>


