markp3rry
markp3rry

Reputation: 734

MVC routing under a domain

I have just published an MVC application. It has a Home controller with a method Create.

The URL is http://www.myurl.com The name of the virtual directory in IIS is myurl.

When I submit the form that posts to Home/Create I'm getting an error because it's trying to send the data to:

http://www.myurl.com/myurl/Home/Create

rather than:

http://www.myurl.com/Home/Create

I tried adding this route:

routes.MapRoute(
                "test",
                "Home/CreateNewPlayer",
                new { controller = "Home", action = "CreateNewPlayer" }
                );

but that hasn't made any difference. Can someone please help me out?

Upvotes: 0

Views: 28

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038820

You should not host your application in a virtual directory but rather directly inside the website which has a binding to the www.myurl.com domain.

Upvotes: 1

Related Questions