Is it possible to import/convert a mod_rewrite .htaccess file to web.config using the command line (NOT using GUI as described here) and how ?
If it is not directly possible is there any workaround for this ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It isn’t possible to do this from the command line. The importer code is part of the UrlRewrite extension code and only surfaced via the IIS manager UI.
That said, if you have .NET Reflector (or a similar tool – ILSpy) you can inspect the code that performs the
mod_rewritetranslation.From my own investigations, the UrlRewrite extension lives inside the following assemblies:
These reside in the GAC and can be opened quite easily for inspection by .NET Reflector.
The classes and methods of interest are:
Microsoft.Web.Management.Iis.Rewrite.Translation.ImportRulesPage.Translate()which calls:
Microsoft.Web.Management.Iis.Rewrite.Translation.Translator.Translate()From this information it may be possible to reverse engineer your own command line implementation.