HTTP redirect to HTTPS with status code 308 when check my website on MX Toolbox email health

http | mysite.com | The remote server returned an error: (308) Permanent Redirect. (http://mysite.com)

this link

I check my site on MX Toolbox and get this error.
Please help me how to fix this one?

Thanks!!

Hello,

can you send the link how you are testing this?

this link

Thank you

Hi,

This is because currently horse-trader.co.uk is redirecting to www.horse-trader.co.uk with 308 and mxtoolbox likely doesn’t understand the redirect.

➜  ~ curl -I horse-trader.co.uk
HTTP/1.0 308 Permanent Redirect
Content-Type: text/plain
Location: https://horse-trader.co.uk/
Refresh: 0;url=https://horse-trader.co.uk/
server: Vercel

You can try setting up 301 redirect which should resolve the issue: Does Vercel support permanent redirects?

1 Like

Hi, thank you for your response

I changed to 301 status, and updated redirects in next.config and re-deployed

async redirects() {
    return [
      {
        source: '/:path*',
        has: [{ type: 'host', value: 'horse-trader.co.uk' }],
        destination: 'https://www.horse-trader.co.uk/:path*',
        permanent: false
      }
    ]
  },

but when run

curl -I http://horse-trader.co.uk => 308 !!!!
curl -I https://horse-trader.co.uk => 301

Could you help to review these?

1 Like

I’m having a similar problem at the moment whereby I need a http request to go to 301 instead of 308.

I managed to have the https request point to 301 by using vercel.json
However. I am struggling to do this with http, I’ve tried Edge Middleware & Serverless functions to force it or intercept headers to get it to somehow be a 301 but no luck. I could be skipping out on core details here, let me know if I am.

My conclusion is that it’s probably a ME issue, or it could be that Vercel is somehow interfering with the http requests & forcing it to become https resulting in a 308.

1 Like

Same issue here! :person_raising_hand:t5: I need to find a setup where http://my-domain returns 301 and I have not found a solution yet.