Umbraco 7.4 Protect Media Items (Not Viewable by visiting the URL)
Hi,
Does anyone know of any way to project media items within a certain folder.
I have some files stored in a folder within the Umbraco media section which need protecting for example everything in the passports folder.
I basically want it so if anyone tries to navigate to the media URL the link just dies or redirects them to a page not found or something.
/media/1199/passport-australia.png
I don't want to use MediaProtect and I don't need any type of login to the files. A simple try the link and the file isn't delivered to the user (as if it doesn't exist).
I can see this might be difficult since the URL doesn't contain any information as per the folder. My plan be is to add a re-write rule in my web.config that looks for anything with the word passport and I will make sure all the files I upload that need protecting have this keyword.
So my plan B works a treat. I am still interested to how anyone else is handling this?
Here is what I did.
All my files will share a similar name (contain the work passport)
So I simply add a re-write rule to the main website web.config to look for this keyword in the URL and if it finds it them re-direct to my default page not found.
Place the code within the system.webServer tags in your web.config
<system.webServer>
<!-- rewrite settings to be put in here -- >
</system.webServer>
This is the example of my re-write information I added within the system.webServer
Umbraco 7.4 Protect Media Items (Not Viewable by visiting the URL)
Hi,
Does anyone know of any way to project media items within a certain folder.
I have some files stored in a folder within the Umbraco media section which need protecting for example everything in the passports folder.
I basically want it so if anyone tries to navigate to the media URL the link just dies or redirects them to a page not found or something. /media/1199/passport-australia.png
I don't want to use MediaProtect and I don't need any type of login to the files. A simple try the link and the file isn't delivered to the user (as if it doesn't exist).
I can see this might be difficult since the URL doesn't contain any information as per the folder. My plan be is to add a re-write rule in my web.config that looks for anything with the word passport and I will make sure all the files I upload that need protecting have this keyword.
Maybe someone has a better solution.
Kind Regards
David
Hi,
So my plan B works a treat. I am still interested to how anyone else is handling this?
Here is what I did.
All my files will share a similar name (contain the work passport)
So I simply add a re-write rule to the main website web.config to look for this keyword in the URL and if it finds it them re-direct to my default page not found.
Place the code within the system.webServer tags in your web.config
This is the example of my re-write information I added within the system.webServer
Now if anyone tries to visit a url containing the word passport then they are re-directed. Eg. http://mydomainname/media/1199/passport-australia.png
Hope this solution helps someone else. Anyone with the better solution let me know.
Kind Regards
David
is working on a reply...