vamsi penta
vamsi penta

Reputation: 73

Redirect .aspx url to one without it

I would like to get my URL redirect from a legacy URL with .aspx to one without it using IIS.

Example:

  1. https://www.example.com/category.aspx to https://www.example.com/category
  2. https://www.example.com/category.aspx?type=test to https://www.example.com/category?type=test

Can we achieve the redirect of the above type using IIS? Please help me with this.

Thanks in advance.

Upvotes: 1

Views: 206

Answers (1)

mcbr
mcbr

Reputation: 781

You can do this in IIS with URL Rewrite module. You can configure it in IIS manager. Some examples are in the documentation. This redirecting rule should work.

<rewrite>
    <rules>
        <rule name="Redirect from aspx" stopProcessing="true">
            <match url="^(.+?).aspx" />
            <action type="Redirect" url="{R:1}" appendQueryString="true" />
        </rule>
    </rules>
</rewrite>

Upvotes: 1

Related Questions