Justina Seliokaite
Justina Seliokaite

Reputation: 55

MVC redirecting folder to page

So I have page: localhost/Transport/Index - which is my main page.

Now when I go to localhost/Transport - I get error that page is not found.

Note that Transport is a "folder"

How can I redirect that to Index or any other page?

Upvotes: 0

Views: 35

Answers (1)

Pankaj Nema
Pankaj Nema

Reputation: 165

I also faced this problem because of same name of Controller and any Folder. To resolve this I added a handler to my web.config, handler section.

    <add name="ApiURIs-Transport-Integrated-4.0" path="YOURCONTROLLERNAME/*" type="System.Web.Handlers.TransferRequestHandler" verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" preCondition="integratedMode,runtimeVersionv4.0" />

Hope it will help.

Upvotes: 1

Related Questions