Reputation: 1163
I implement a website with ASP.net MVC. Everything works fine in offline. But the problem is that when I upload in my host, it adds the name of my root folder to the URL.
I want to upload my project in GoDaddy Plesk hosting. My GoDaddy host is the kind that I can have more than one domain setting on it. So I have four different web sites on it.
The other websites are just simple html websites and works fine and the URL is just the domain with nothing added more.
But this project is with ASP.net MVC. For example suppose my domain is www.example.com
and I create a folder named example
in the root for this project's root, then after uploading my project in the folder example
as project root, then I added IIS management
for my domain.
Now when I type www.example.com
in the browser, it redirects to www.example.com/example/id
and I do not want this to add the name of my root folder to my URL.
I am not sure if the problem is in my side or some settings in GoDaddy but here is my route config:
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
I need my URL to be just www.example.com/id
Appreciate any help.
Upvotes: 2
Views: 273