_redirect but keep the same origin (transparent)

Hi all

[Sorry for the weird url links but I can’t have more than 6 as I’m a new member]

I have the following:

  • a wordpress blog available on exampledotcluster027dothostingdotovhdotnet
  • a netlify app available on wwwdotexampledotcom

I want that

  • when I hit www example com slash app I get the actual netlify app
  • when I hit www example com slash * I get redirected to the blog while keeping the same url

www.example.com/blog would be a transparent redirect to example.cluster027.hosting.ovh.net/blog

Here is what I’ve tried in my _redirects file
/app/* /index.html 200
/* https://example.cluster027.hosting.ovh.net/:splat 200!

If I hit www.example.com/blog, it gets me redirected to https://example.cluster027.hosting.ovh.net/blog and what I want is to keep wwwdotexampledotcom slash blog but WITH the content of exampledotcluster027dothostingdorovhdornet slash blog

I hope I’m clear enough and that you can help me

Thanks

Hi, @martinratinaud, and welcome to our Netlify community site. :slight_smile:

The rule use used should have worked from what I can see. In order to troubleshoot why is isn’t working, I’ll need the actual URL at Netlify which isn’t redirecting or proxying correctly.

Or, if you prefer, you can send us the x-nf-request-id header for the request which didn’t proxy correctly.

Would you please send us either set of information above and we’ll be happy to research this further?

Sure Luke, thanks

The website is http://remote-family.netlify.com/

and the actual website https://spot.remote-family.com

Hey Luke do you have anyy news ?
Am I doing something wrong?

Thanks you

Hi, @martinratinaud, I’m seeing the redirects below defined for this site:

https://spot.remote-family.com/cuisine-tendance/* https://www.<redacted>/:splat 200!
/cuisine-tendance-2/* https://www.<redacted>/:splat 200!
/test/* https://<redacted>.cluster027.hosting.ovh.net/:splat 200!
/*   /index.html   200

The first one doesn’t work because that domain (spot.remote-family.com) isn’t pointing to Netlify:

$ dig spot.remote-family.com  +noall +answer

; <<>> DiG 9.10.6 <<>> spot.remote-family.com +noall +answer
;; global options: +cmd
spot.remote-family.com.	299	IN	A	104.27.153.245
spot.remote-family.com.	299	IN	A	104.27.152.245

Those are not our IP addresses so we cannot control what that domain does. In order to use a custom domain with a Netlify site, it needs to be configured according to the instructions here for external DNS or here for Netlify DNS.

The second rule is working and the URL below proxies:

The third rule doesn’t work because the proxy is to an HTTPS endpoint but there is no working SSL for that URL. The URL below gives a 502 for that reason:

Would you test changing that rule to http:// instead of https://?

The last rule is working and this proxies to index.html:

https://remote-family.netlify.com/not-a-real-file-path

I hope this helps. If there are other questions about this, please let us know.

Hi Luke and thanks for your very detailed answer

I use cloudflare and here is my DNS entry for this subdomain

It looks like it is what is written in https://docs.netlify.com/domains-https/custom-domains/configure-external-dns/#configure-a-subdomain

or maybe I’m mistaking?

I changed the https to http

Thanks

Are you using the Cloudflare CDN in front of Netlify? If so, this article explains about why that isn’t supported:

You can use their DNS, but please bypass their network/CDN at described in the common issue topic above. If that doesn’t resolve the issue, please let us know.

I am indeed, thanks for pointing that out.

I will remove cloudflare and make some tests again.

Thank you for your support

1 Like

Hi and thanks for this

I

  • removed cloudflare
  • configured netlify DNS
  • added entries to _redirects file

and it works (or almost)

It seems sometimes the _redirects file is bypassed
for example

sometimes gives the result of
https://wordpress.remote-family.com/sitemaps.xml

instead of the existing file

Is there a cache somewhere ? that can be flushed ?

Thanks again for your help

Jumping in after a quite a bit of conversation but was wondering if you’re still experiencing this @martinratinaud?

When I go to https://www.remote-family.com/sitemap.xml in a private window in Firefox, this is what I see:

Is that correct or is the outcome you’re looking for that

Hi Jen and thanks

It works now thanks

but for some time after deployment (maybe one or 2 days), the _redirects acted as if it was not here at all. Is it possible that there would be some propagation issue ?

Thanks

Hmm, that is very strange. We are not seeing anything system-wide that should be causing behaviour like that, and without additional information its basically impossible to debug after the fact.

If you see something like that happening again, please let us know and we will try to look in to it!

Thanks for the awesome support and the series C funding. You guys rock!

1 Like

thank you @martinratinaud! Appreciate your support.