How to create a url alias using IIS URL Rewrite

Want to allow someone to shortcut their way to a particular part of a website? Jonathan Yong, one of our Premier Field Engineers from Malaysia, shows you how!

Problem: I have a url or domain that is very long! How can I create a shorter url that acts as an alias, which maps to a subfolder under the long url?

Example: Instead of going to, I want people to simply go to

Answer: You can use the IIS URL Rewrite module to create a rule which maps one url to another.

Prerequisites: This solution only works with IIS 7 and above.

Details: In the following, I will show you step by step how to accomplish this. There’s also a sample file included (see the download link at the bottom of this page) so that you can try this in your own environment.


Download and install the IIS URL Rewrite module from

If IIS Manager is running when you install URL Rewrite, you will need to close and reopen it in order to see the URL Rewrite configuration tool icon.



Next, I will copy the files and folder necessary to set up my web site.

  • Extract the sample code
  • Open an elevated command prompt (Start, CMD, Ctrl+Shift+Enter, Yes)
  • Go to the extracted sample code folder in the command prompt.
  • Run 01-copy_file.bat. This will copy the sample files to c:\inetpub\verylongurl folder.

Don’t close the command prompt yet. We still need it for subsequent steps.



I will create a web site which maps to the folder above and has two bindings, using host headers.

  • The web site name is ‘Long URL Web Site’.
  • The port number and host header binding is : 80/ and 80/

From the command line, run 02-create_site.bat to create the web site.



On the Internet, we’d need to add both hostnames to DNS so that users can surf to the site.

In our test environment, we simply add this to the HOSTS file on any computer we’re testing from.

  • Open a notepad elevated as Administrator (Start, NOTEPAD, Ctrl+Shift+Enter)
  • Open the HOSTS file in C:\Windows\System32\drivers\etc\hosts.
  • Add the following two domain name to the hosts file and save it.



We will now create the URL Rewrite rule which maps the short url to the long url.

  • Go back to IIS Manager.
  • Click on the ‘Long URL Web Site
  • Double click the URL Rewrite icon to open the URL Rewrite configuration.


In the URL Rewrite configuration, click on the Add Rule(s) link in the Actions pane on the right hand side.



Select the Blank rule template and click OK.



In the Edit Inbound Rule screen,

  • Enter “URL Alias” (or any name you like) in the Name textbox,
  • Make sure Requested URL is Matches the Pattern,
  • Make sure Using is Regular Expression,
  • Enter “.*” in the Pattern textbox.



Click the down arrow to expand the Conditions title, then click Add.



In the Add Condition dialog,

  • Enter {HTTP_HOST} in the Condition input textbox;
  • Select Matches the Pattern in the Check if input string;
  • Enter in the Pattern textbox
  • Click OK.



Scroll down further to the Action section.

  • In the Action type, select Rewrite.
  • Enter “/subfolder/{R:0}” in the Rewrite URL.
  • Tick the checkbox on Stop processing of subsequent rules.



Click the Apply link on the top right of the Actions pane.

The configuration is saved to the web.config file in your web site folder. You may open this web.config file to review how the configuration is being created under the hood.


Let’s review what we just did from step 8 to 11:

  • We create a rule that matches all incoming urls (step 8), and
  • If the host in the url matches “” as specified in the Conditions section (step 9 and 10),
  • Rewrite the url to “/subfolder/<incoming url>” (step 11).

If you browse to, the url will rewrite to

However, if you browse to, the url will not be rewritten because it does not match the host name we are looking for, which is “”.

To see this in action, browse to the following pair of urls and you should see that each pair will show you the same page.

Test A:

Test B:

You can learn more about URL Rewrite module here.

Download the sample file here:


Posted by Tristan “Bridesmaid” Kington, MSPFE Editor

Comments (42)

  1. Balu Kalepu says:

    Hi, Thanks for the great post.

    I have a challenge. Currenlty one of our application is running on Port 80. (Ex:
    But few of the pages are hard coded to use a different port (Ex:

    How can we remove the port number 1025 from the URL using URL Rewrite?

    Balu Kalepu

  2. MY NAME IS: says:


  3. Jenny says:

    La Empresa se reserva el derecho inviolable a quitar la opción Cómpralo Ya de una
    subasta particular.

  4. Hello everybody, here every person is sharing these experience, thus it’s nice to read
    this blog, and I used to pay a visit this weblog everyday.

  5. どれだけトイレが頻繁かというと、就寝後は平均して4度ぐらいはトイレに駆け込むくらいなので困ります。







  6. 他人と比較しておしっこが近くなる頻度が多いと思う








  7. Hi there, You have done an excellent job. I’ll definitely digg it and personally suggest to my friends.
    I’m confident they’ll be benefited from this website.

  8. test says:

    Truly no matter if someone doesn’t know then its up to other viewers
    that they will help, so here it takes place.

  9. This is the perfect web site for anyone who really
    wants to understand this topic. You know a whole lot its
    almost hard to argue with you (not that I personally would want to…HaHa).
    You certainly put a new spin on a topic which has
    been discussed for ages. Wonderful stuff, just wonderful!

  10. Method Of Findinng A Roulette Game Online

  11. Brittany says:

    Postcatd Marketing Has Gotten Harder, An Individual Must
    Be Smarter

  12. Jeanna says:

    The listt runs in order to incclude many decisions,
    big and small. Thewre are many fun sign options provided.pick one that works for
    you. Online users are trying to studxy the facts.

  13. Leonardo says:

    Are you looking regarding your option enhance double also triple revenue out oof yourr weblog?
    Getting also be configured goes and delineate specific splaces within the trade sshow space.

  14. casinos in says:

    What i don’t realize is if truth be told how you are now not
    really a lot more neatly-liked than you may be right now. You’re very intelligent.
    You recognize therefore considerably with regards to this
    subject, made me for my part believe it from so many numerous angles.
    Its like women and men don’t seem to be involved until it
    is one thing to do with Girl gaga! Your own stuffs nice.
    At all times handle it up!

  15. It’s really a great and useful piece of info. I am happy that you simply shared this useful information with us.
    Please keep us up to date like this. Thanks for sharing.

  16. 香川県のプラチナ買取のエキスパートが教える手蔓。訃報を整理しますね。香川県のプラチナ買取のプロが教える触接する。色々書くと思います。

  17. Wow! In the end I got a blog from where I can really obtain useful information regarding my study
    and knowledge.

  18. Do you have a spam issue on this site; I also am a blogger, and I was curious about
    your situation; we have created some nice practices and we
    are looking to swap strategies with other folks, be sure
    to shoot me an e-mail if interested.

  19. Nebst Stab des „Emergency Medical Service“
    wurden spezielle Zentren zum Besten von Chip
    von Verletzten anhand die „Bombardements“ möbliert.

    Gillies (. Abb. 4.3) setzte sich für das
    Schaffen von geeigneten Einrichtungen zu Gunsten von die
    Erörterung aller Patienten, des Militärs, solcher zivilen
    Bevölkerung und jener bleischwer Brandverletzten
    Chip eine plastisch-chirurgische Behandlung benötigten.
    Die plastisch-chirurgischen im Übrigen maxillofacialen/
    kieferchirurgischen Zentren wurden zu
    Ausbildungsstätten zum Besten von Chirurgen jener westlichen
    Alliierten mit beachtlichen Fortschritten hinauf diesen
    Ähnliche Einheiten sind in den Army and
    Navy General Hospitals in den Amerika möbliert
    worden. Handchirurgische Zentren, in einem großen Rundumschlag
    verbunden einschließlich plastisch-chirurgischen Zentren,
    standen zwischen jener Geschäftsführung von Bunnell.
    In den
    Jahren des 2. Weltkrieges erreichten in der Öffentlichkeit
    ausgewählte Plastische Chirurgen denn Wallace,
    Clarkson, Mathews, Gibson, Mowlem weiterhin
    viele andere Ehrerbietung ebenso Kontakt.
    Chip Vielheit von 25 britischen Fachärzten für Plastische
    Chirurgie wurde erreicht.
    Das größte britische Innenstadt entstand in East
    Grinstead zu Händen die „Royal Air Force anhand McIndoe
    qua Kommandeur“. In DEM City konnten bis
    zu 200 Patienten aufgenommen ferner „zahlreiche
    britische Plastische Chirurgen geschult werden“.

    Dank ihre Tätigkeit hatte dasjenige Domäne in der
    britischen Öffentlichkeit großes Würdigung
    McIndoe wurde wenn schon für der/die/das ihm gehörende Leistungen
    in den Adel erhoben (McDowell 1978).
    Gleichgerichtet durch DEM nächtlichen Einlagekapital der
    V1 und V2 anhand London im Anno 1943 mehr noch dieser
    indem groß gesteigerten Zahl der Verletzten
    wurde dasjenige „Wundermittel“ Penicillin in den plastisch-
    chirurgischen Einheiten verlässlich. Im Februar
    1944 wurde auf welcher Basis einer von Seiten Mowlem
    geleiteten Probelauf durch Chip einschließlich dem „Antibioticum“
    erreichten Resultate gemeinsam nachdenken. Chip 24 beteiligten
    Chirurgen hatten im Sinne solcher Softwareanwendungen von Seiten Penicillin
    eine beachtliche Verbesserungen der Ergebnisse
    erreichen Gewandtheit. Obschon einer Pause
    rief „Sir Harold“, jener zum Schweigen aufgerufen
    hatte, „was denkt ihr ‚chaps‘ oberhalb dieses Zusammenschreiben eines
    ‚Plastic Club‘?“ Die Entgegnung war alsbald darüber
    enthusiastisch. Gemäß Erarbeitung solcher notwendigen
    Einzelheiten wurde nahe welcher Wiedersehen
    am 20.5.1944 in London Chip Satzung jener British
    Association of Plastic Surgeons beschlossen. Pro
    die Bevorzugung solcher Gründungsmitglieder angenommen, dass eine
    „Association“ kultiviert Entstehen. Demgemäß mussten
    Chip Vorbereitungen unterbrochen werden. Ebendiese
    konnten einleitend im Warme Jahreszeit 1946 zum wiederholten Mal aufgenommen
    werden (Barron 1987).

  20. Eloise says:

    Wow, that’s what I was searching for,what a material!
    present here at this weblog, thhanks admin of this web site.

  21. I have been browsing online more than i care to admit today, yyet I never found interesting article ike this one.
    Personally, if all webmasters and bloggers made good content as you did, tthe web will be much mmore
    useful than eever before.

  22. Oligopeptides have 10 or less amino acids.

  23. says:

    So now it comes full circle back to the average
    person who may have taken on the role with the blogging site
    administrator. Anyone can compose and write about any topic, from hobbies
    to political vies. A blog writing service knows how to spark a person’s
    eye to your services, which will drive increased traffic and result in higher revenues for your company.

  24. 1. The clinic gives the providers you need.

  25. I am training your own business plan today using a team of folks and that we project this business will grow large
    for us. This is going to be your very first impression at single people around, so never post a photo
    which will send a bad message and you will regret in the end.
    Just because it’s free as well as simple to start out do not for the minute underestimate
    how powerful it really is.

  26. Foto Bugil says:

    Thanks a bunch for sharing this with all folks you actually understand what
    you’re talking about! Bookmarked. Please additionally seek advice from my website =).
    We may have a hyperlink trade arrangement between us

  27. They’re outstanding as an addition to any salad!

  28. I am genuinely thankful to the holder of this site who has shared this fantastic article at at this time.

  29. imports news says:

    whoah this weblog is wonderful i love reading your articles.
    Stay up the good work! You understand, many people
    are searching round for this information, you can aid them greatly.

  30. The phone is integrated with 8-GB and 16-GB memory and expandable Micro – SD memory card option that supports around 32GB
    memory. Try to research before leaving your home about the lifestyle in the
    location. Possible complications inlcude drug reactions, infection,
    bleeding, or perforation with the intestinal tract
    which could require surgery.

  31. What you need to have is willpower to become taught the
    best way to create profitable blogs and make your organization stable.
    If one is careful never to offend, the real key or she could generate 1000s of
    new readers. The informal style of your blog post gives Internet consumers to
    be able to familiarize yourself with individuals who’re behind the organization better, which makes
    it easier so they can trust you and also purchase your site.

  32. Many argue that the roll-out of technology towards
    the making decisions process would completely eliminate any human error.
    So, in ways gaming can be a teenagers or anyone’s friend since it entertains there young brains as long
    since they are playing good games. With these i – Pad giveaways, the consumers get their hands around the latest
    gadgets even though the manufacturers have the ability to have their
    products tested.

  33. Awesome issues here. I’m very satisfied to peer your post.

    Thanks a lot and I am looking forward to touch you. Will
    you please drop me a mail?

  34. says:

    What you need to have is willpower to get taught the way to create wealth creation blogs whilst
    your company stable. However, each time a blogger does enjoy what he writes about, he’ll probably adhere to it for a
    time. The informal style of your blog post gives Internet consumers to be able to get
    acquainted with the people who are behind the organization better,
    that makes it easier so they can trust you and also buy your site.

  35. news 9 dc says:

    Stick with what you are doing, or find another and better online strategy to change the free classified
    strategy. Anyone can compose and talk about any topic, from hobbies to political vies.
    This is a gesture of excellent will hoping that other bloggers can do the

  36. Amazing blog! Do you have any helpful hints for aspiring writers?
    I’m planning to start my own website soon but I’m a little
    lost on everything. Would you propose starting with a free platform like WordPress or go for a
    paid option? There are so many options out there that I’m totally confused ..
    Any ideas? Cheers!

  37. Would making 8 or 10 thousand dollars a month from a simple
    blog make positive changes to life. By recognizing
    this, you’ll be able to tweak posts or pages and perhaps give visitors another road
    to take. No matter how big or small the business
    is, it is the most efficient tool for them.

  38. I got this web site from my pal who informed me about this site and now this time I am
    browsing this website and reading very informative articles or
    reviews here.

  39. BMW drivers can walk at night hotel register counter and directly enter in the
    booked room. There has been a sudden increase in advertisements from companies thinking about buying your mismatched, misshapen, unwanted or unused gold items.
    In addition, they used a great deal of electricity, generated a lot of heat
    which has been some of the reason behind malfunctions.

  40. Thank you for any other informative blog. The place else could I get that type of info written in such a perfect manner?
    I’ve a project that I’m simply now running on, and I’ve
    been at the glance out for such info.

Skip to main content