# Redirects do not behave as expected

**URL:** <https://answers.netlify.com/t/redirects-do-not-behave-as-expected/16613>\
**Category:** Support\
**Tags:** redirects, netlify-newbie\
**Created:** [June 10, 2020, 2:11pm UTC](https://answers.netlify.com/t/redirects-do-not-behave-as-expected/16613 "2020-06-10T14:11:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy.b](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jeremy.b/32/11249_2.png) [@jeremy.b](https://answers.netlify.com/u/jeremy.b)\
**Post date:** [June 10, 2020, 2:11pm UTC](https://answers.netlify.com/t/redirects-do-not-behave-as-expected/16613/1 "2020-06-10T14:11:01Z")

</div>

Hi

Let’s start with a bit of context, I have created a statically generated blog that we want to display as a subfolder of our website hosted elsewhere. ([Blog | 360Learning](https://360mooc.com/blog/))

I am not very experimented on this subject but I understood that I needed to deploy the blog on the main domain and proxy requests that are meant for the website from Netlify.

Here are the redirects rules that I added to netlify.toml

```plaintext
[[redirects]]
    from = "/blog*"
    to = "/blog:splat"
    status = 200
    force = false

[[redirects]]
    from = "/*"
    to = "http://website.360mooc.com/:splat"
    status = 200
    force = true
    headers = {X-From = "Netlify", X-Forwarded-Host = "360mooc.com"}

```

However, when I tried accessing the base route ([https://360mooc.com](https://360mooc.com)) after that, netlify responded with a 301 redirect instead of a 200 proxy.

```auto
age: 32
content-length: 178
content-type: text/html
date: Wed, 10 Jun 2020 13:36:33 GMT
location: https://website.360mooc.com/
server: Netlify
status: 301
x-content-type-options: nosniff
x-nf-request-id: 35132e8a-bef8-4da2-896b-cbae76fec0ee-3441662

```

I have tried redeploying and clearing my local cache and the cache of Netlify  
 ![image](https://global.discourse-cdn.com/netlify/original/2X/8/8d1adf63ac6f2d34fbf071b31f791cdfab173831.png)

EDIT: The weird thing is that the redirects work as intended on my netlify subdomain [https://360mooc.netlify.app/](https://360mooc.netlify.app/)

Does anyone know what could be the issue here?

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [June 11, 2020, 7:59am UTC](https://answers.netlify.com/t/redirects-do-not-behave-as-expected/16613/2 "2020-06-11T07:59:02Z")

</div>

Hi, @jeremy.b, the 301 redirect is coming from the site being proxied to:

```nohighlight
$ curl -svo /dev/null http://website.360mooc.com/ 2>&1 | tail -n 12
< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Thu, 11 Jun 2020 07:56:40 GMT
< Content-Type: text/html
< Content-Length: 178
< Connection: keep-alive
< Location: https://website.360mooc.com/
< X-Content-Type-Options: nosniff
<
{ [178 bytes data]
* Connection #0 to host website.360mooc.com left intact
* Closing connection 0

```

This happens because you are proxying to the HTTP (not the HTTPS) url:

```nohighlight
    to = "http://website.360mooc.com/:splat"

```

If you change that to the HTTPS version, it should return a 200 response:

```nohighlight
    to = "https://website.360mooc.com/:splat"

```

If there are other questions, we’ll be happy to answer.

---

<div class="post-metadata">

**Author:** ![jeremy.b](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jeremy.b/32/11249_2.png) [@jeremy.b](https://answers.netlify.com/u/jeremy.b)\
**Post date:** [June 11, 2020, 10:54am UTC](https://answers.netlify.com/t/redirects-do-not-behave-as-expected/16613/3 "2020-06-11T10:54:08Z")

</div>

Hi @luke,

This solves my problem, thanks for your answer.
