1

I am trying to change the default URL of my Asp.Net website on IIS. At the moment the URL leading to the default index.html, is just http://myservername/. But I would actually prefer to extend the URL to http://myservername/route1, which then still routes to the default html. How can I achieve this?

1 Answer 1

2

Download Microsoft URL Rewrite Module and install it

and add this to your web.config

<system.webServer>
    <rewrite>
        <rules>
            <rule name="Root Hit Redirect" stopProcessing="true">
                <match url="^$" />
                <action type="Redirect" url="/route1" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
Sign up to request clarification or add additional context in comments.

2 Comments

I'm getting a 404 error now. Probably because the route1 does not lead to anything to the website. How can I fix this?
In IIS creating an application 'route1' inside the website was the solution. However the rule you gave is perfect to redirect users which route to the websites url.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.