Click here to Skip to main content
15,891,655 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using VS 2013 and MVC5
To host the application in IIS, i have used Properties-> Web ->Servers ->Local IIS and clicked on Create Virtual directory.
So this created a VD for "MyPortal"

But now i have a path problem.

I have an api controller in my application.
When i was using VS development server it was being accessed using the url : http://localhost:1553/api/menuapi and the data was getting accessed correctly.

But once it is hosted to IIS, it stopped working.
When checked, it is trying to fetch the data from url i.e :
http://localhost/api/menuapi and it gives a 404 error.

But actually the api is fine and the data is accessible from the url :
http://localhost/MyPortal/api/menuapi

Why and how is this path problem created?
The below is how i am doing the api call :
1. In javascript file :
JavaScript
$http.get('/api/menuapi/' + menuid).success(function (data) {});

Please suggest if any alternatives.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900