IIS url rewrite rule for web application

yadavdep
yadavdep used Ask the Experts™
on
Under my IIS and under website I have multiple web application hosted.
I need to apply an SSL certificate on my Website but I need to keep all my web application to keep running on HTTP which are under my website except only one.
I need to write a url redirect rule for this web application so that all the http://xxx.com/MyWebapplication can be redirected to https://xxx.com/MyWebapplication.

I tried the writing the matching pattern but did not get any success.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ryan ChongSoftware Team Lead
Commented:
you may try this:
<rule name="Redirect to HTTPS" enabled="true" stopProcessing="true">  
			<match url="(.*)" /> 
			<conditions>  
				<add input="{HTTPS}" pattern="^OFF$" />  
			</conditions>  
			<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />  
	   	</rule>

Open in new window

Author

Commented:
This would be for me website or webapplication?
Because If I do it for my WebSite then I will enable SSL for all my Web applications
Software Team Lead
Commented:
so you only wanted "/MyWebapplication" to be redirected from HTTP to HTTPS?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial