[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 424
  • Last Modified:

IIS rewrite in web.config

Hello everyone, I am fairly new to IIS rewrite stuffs, so I would like some advice. Here is the scenario: I have a site called http://foo/en/us/default.aspx Now I would like to rewrite url in such a way that when people just type http://foo or http://foo/ it should automatically goes to http://foo/en/us/default.aspx as 301 redirect. Please note that I do not have access to IIS rewrite module directly and have to add in web.config manually. Any help or suggestions will be highly appreciated.
0
KoolAsIce
Asked:
KoolAsIce
1 Solution
 
käµfm³d 👽Commented:
You might try:

<rewrite>
  <rules>
    <rule name="redirect">
      <match url="^$" />
      <action type="Redirect" url="http://foo/en/us/default.aspx" redirectType="Permanent" />
    </rule>
  </rules>
</rewrite>

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now