Apple Pay Verification using /.well-known

I am attempting to verify Apple Pay on my domain via Stripe’s requirements listed here: https://stripe.com/docs/stripe-js/elements/payment-request-button#verifying-your-domain-with-apple-pay (basically you host a unique token in a hidden text file).

I found a similar thread that used redirects to redirect /.well-known/* to a file hosted at /well-known/* but Stripe recognized the redirect and it failed.

I would appreciate any help.

Evan

Hi, @EvanOlsen, redirects are 301 redirects if no status cod is included in the redirect rule itself. If you specify the status and make the rule a 200 status, our service will proxy to the new endpoint (serving the other URL at the existing URL - no redirect).

I think if you make the redirect a 200 status, this should work. Would you please try that and let us know if it does not or if there are any questions?

1 Like

Hey @EvanOlsen :wave:t2:

@luke’s advice is totally spot on for redirects, and you’ll find that using the status = 200 (or just 200 in the _redirects file format) is super powerful, but I did want to point out another option to consider.

Netlify by default will convert any folder’s index.html file into a url path that’s just the folder name with a trailing slash. So there shouldn’t be anything preventing you from making a .well-known folder (the folder name contains a dot) with an index.html inside that’s just plain text or whatever that content needs to be. That should render at /.well-known/. That can be helpful too if you have other files that need to go after that path too.

Redirects or files, either way you should be able to get it rolling :sunglasses:

Cheers!


Jon

1 Like

Fantastic advice, @luke and @jonsully! You were right, adding “200” resolved the issue completely. Thank you!

1 Like