Solved

IIS 7.5 URLRewrite to add a suffix. How?

Posted on 2014-01-05
1
127 Views
Last Modified: 2016-04-09
Hi.

I'm using IIS 7.5 and I need to use URLRewrite module to force the "https://www." suffix to any URLs that don't have that.

For example:

a. domain.com should become https://www.domain.com

b. domain.com/abc/xyz.aspx should become https://www.domain.com/abc/xyz.aspx

c. https://domain.com should become https://www.domain.com

d. https://domain.com/abc/xyz.aspx should become https://www.domain.com/abc/xyz.aspx


I'm having a hard time writing that script. Any helps are greatly appreciated.

Thanks in advance,

Helder Conde
0
Comment
Question by:HelderConde
1 Comment
 
LVL 61

Accepted Solution

by:
btan earned 500 total points
ID: 39758565
May want to see this

http://forums.iis.net/t/1153050.aspx?URL+Rewrite+for+SSL+redirection
http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/


<rewrite>
<rules>
    <clear />
    <rule name="Force HTTPS" enabled="true">
        <match url="(.*)" ignoreCase="false" />
        <conditions>
            <add input="{HTTPS}" pattern="off" />
        </conditions>
        <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" appendQueryString="true" redirectType="Permanent" />
    </rule>
</rewrite>

Also the below tips can come handy
http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now