Support Forums

_redirects syntax to allow access to all files of a certain type?

My _redirects file has the following entry …

/**.kml 200!

… but when I try to grab a *.kml file from my site, I get bounced to the login screen.

How can I provide unauthenticated access to *.kml (at any public location)?

This is followed by …

# Family and admin get access if authenticated.
/* 200! Role=family,admin

# Everyone else bounces to login.
/* /login 302!

… in the _redirects file.

hi there, @scouten :wave:

Before we dig in, did you see this Support Guide on debugging redirects? If you haven’t, please give it a thorough read through and see if the suggested debugging steps fix your problem:

if not, please reply to this thread with what you have tried as well as a link to your site, and we’ll try and troubleshoot.

I’ve read the support guide and each of the specs listed below that and I don’t see any description of how to write a wildcard that targets a file extension regardless of the intermediate path structure.

If that isn’t supported, just let me know and I can try another route; if it is supported, I’d prefer to keep the existing path structure and adjust the _redirects file accordingly.

The site is private to my family and I’d prefer not to advertise the URL in public; happy to respond privately via e-mail with additional details.

Eventually figured out that I was close. The following syntax works:

/**.kml /**.kml 200!