nobody
nobody

Reputation: 11090

IIS - Redirect http requests from url to another url in the same folder

I have an asp page as part of of web application hosted on IIS8. I would like to set up http redirection from this page to another aspx page within the same site.Isn't there a straightforward setting I can use in IIS? I've looked at http redirect and url rewrite with little luck.

Requests to

http://localhost/example.asp 

needs to be redirected to

http://localhost/example.aspx 

Upvotes: 0

Views: 9308

Answers (1)

nobody
nobody

Reputation: 11090

I figured it out. I was missing the URL Rewrite module.It can be downloaded here.Once you download, install the url rewrite module and it will look like this.Open the feature and add the rule.

enter image description here

Once you add a new rule it will show up in the web.config file under system.webserver tags or you can add it to the web.config file directly.

<system.webServer>
<rewrite>
    <rules>
        <rule name="asp_to_aspx" stopProcessing="true">
            <match url="^example.asp$" />
            <action type="Redirect" url="http://localhost/example.aspx" />
        </rule>
    </rules>
</rewrite>
</system.webServer>

Upvotes: 1

Related Questions