IIS url rewrite rule for web application

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.
yadavdepAsked:
Who is Participating?
 
Ryan ChongConnect With a Mentor Commented:
so you only wanted "/MyWebapplication" to be redirected from HTTP to HTTPS?
0
 
Ryan ChongConnect With a Mentor 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

0
 
yadavdepAuthor 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
0
All Courses

From novice to tech pro — start learning today.