callumbwhyte / friendly-robots

A friendly tool for creating dynamic robots.txt files in Umbraco
MIT License
7 stars 1 forks source link

Handling subfolders from disallowed folders #3

Closed NikRimington closed 3 years ago

NikRimington commented 4 years ago

Hey Callum,

I've found a scenario where the current rendering process won't work. If you need to allow access to a specific file/folder but deny access to the rest of a directory you need to do something like this:

Allow: /App_Plugins/UmbracoForms/Assets/Themes/Default/umbracoforms.js
Disallow: /App_Plugins/

However, the current rendering process puts all disallowed at the top followed by allowed which would prevent this working. I don't know, however, what the implications of reversing this order is, so if you had all the allowed items followed by the disallowed, it might resolve this issue.

Thanks

Nik

callumbwhyte commented 3 years ago

Thanks @NikRimington,

I think this was an oversight on my part. I've taken your suggestion and flipped the order of Allow / Disallow so that allow should always come first. Hopefully this resolves your issue.

The latest version, v1.2.0, is out now on all good package stores with this fix in place!

Cheers, Callum