Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to do a redirect in IIS6? Using .htaccess? Like:

Order Allow,Deny Deny from all

Is there any way to protect swf files from public users?

share|improve this question

If you want people to be able to view your SWF as part of their web page you cannot refuse them access to the file. That's the bottom line.

If your problem however is that people are linking to your files from other websites you could use an anti-leeching solution such as this to make sure anyone getting your SWF is coming from your website:

Lastly, if you want to disallow them the ability to access any SWF files on your site (meaning they would not be able to download them) simply remove the MIME type from your Virtual Directory.

share|improve this answer

There's plenty of ways of restricting access in IIS6, by permissions, URL re-writing, ASP redirect scripts, you name it, and it all depends on how you differentiate between "public" and "private" users.

If you want .htaccess style granuality, I strongly suggest ISAPI ReWrite. We use it here and it's brilliant. I believe there's a free version these days as well.

share|improve this answer

You can also set the permissions on those files to disallow read access for the IUSR_MACHINENAME user account and IIS will prompt for a username and password if someone tries to access them. This would need to be done on a file/folder basis, however. If you just want blanket protection for all .SWF files regardless of where they are then you would need another method as others have laid out.

share|improve this answer
This doesn't work actually since the client needs to read the file in order to have access to it. – ALOToverflow Mar 5 '10 at 14:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.