In my application I have a route:
routes.MapRoute(
name: "ILRoute",
url: "{*Path}",
defaults: new { controller = "Page", action = "index", Path = "" });
And in my controller I get the path and find what page was called and return the view that I want with page data.
It works fine when I am running on VS 2010 but when I upload to the server I get the error 404 when calling some pages. For example: I have menu that link attr set to ‘channels’. In VS 2010 it works fine and when the menu is clicked the channel page appears but on the server a 404 error appears. I changed the URL in my browser manually to this:
myserverIP/websiteNAme/Home
and in this state when I click on the “channel” menu the page appears! But in the last state the browser says: File or directory not found, browser try to access this URL:
MyServerIP/channel
finally i found solution to solve problem
i use “/” and domain name and menu link like this
“/domainName/MenuLink
so when user click on the menu the url going correctly
tnx every body