I am developing a blog Website in asp.net c# Webform(https://[DELETED].in). I am using using System.Web.Routing & Microsoft.AspNet.FriendlyUrls for routing in webform; Route.Config is as follows: var settings = new FriendlyUrlSettings(); settings.AutoRedirectMode = RedirectMode.Permanent; routes.EnableFriendlyUrls(settings); routes.MapPageRoute("RouteForArticle", "{url}", "~/ViewEntry.aspx"); routes.MapPageRoute("RouteForCat", "default/{Category}", "~/Default.aspx"); I have 2 Problems while hosting to production environment(Godaddy Shared Hosting),those are as follows : 1. parameter {url} is getting checked on every page instead of ViewEntery.aspx. Once {url} is not available then getting error on other pages i.e default page. 2. Url contains the server folder name (http://[DELETED].in/lzblogs_[DELETED].in/Wedding-Photography) Where as "lzblogs_[DELETED].in" is the folder name in which i have hosted the website.Final url should be like http://[DELETED].in/Wedding-Photography Please suggest the solution.
~/lzblogs_[DELETED].in/ViewEntry.aspx
routes.MapPageRoute("RouteForCat", "default/{Category}", "~/Default.aspx");
<rewrite> <rules> <rule name="Remove Virtual Directory"> <match url=".*" /> <action type="Rewrite" url="{R:0}" /> </rule> </rules> </rewrite>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)