Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess or .htpasswd equivalent on IIS?

Tags:

iis

.htaccess

Does anyone know if there is an equivalent to .htaccess and .htpassword for IIS ? I am being asked to migrate an app to IIS that uses .htaccess to control access to sets of files in various URLs based on the contents of .htaccess files.

I did a google search and didn't turn up anything conclusive. Is there a general approach or tool that I need to purchase that provides this capability ?

like image 627
MikeJ Avatar asked Nov 03 '08 04:11

MikeJ


People also ask

Does IIS have htaccess?

These configuration files (usually called . htaccess files) contain a number of settings that can be used for integrating the application with the capabilities of the Web server. IIS 7 and above uses a file called Web. config to hold settings for integration with applications.

Does .htaccess work on Windows Server?

htaccess rules won't work in a Windows server.


2 Answers

For .htaccess rewrite: http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/

Or try aping .htaccess: http://www.helicontech.com/ape/

like image 191
Matijs Avatar answered Sep 23 '22 04:09

Matijs


There isn't a direct 1:1 equivalent.

You can password protect a folder or file using file system permissions. If you are using ASP.Net you can also use some of its built in functions to protect various urls.

If you are trying to port .htaccess files used for url rewriting, check out ISAPI Rewrite: http://www.isapirewrite.com/

like image 21
Tristan Havelick Avatar answered Sep 21 '22 04:09

Tristan Havelick