Forum Moderators: open
every url create like this ...www.mysite.com/newthread.aspx?do=newthread&f=17
i have convert this url in this
www.mysite.com/keyword.html
but when i run in dedicated serve...the html page is not open
what type of setting need for that?
what is the solution...i have windows dedicated server...
i get this error
Server Error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
----
namespace ThunderMain.URLRewriter {
public class Rewriter : IConfigurationSectionHandler {
protected XmlNode _oRules=null;
protected Rewriter(){}
public string GetSubstitution(string zPath) {
Regex oReg;
foreach(XmlNode oNode in _oRules.SelectNodes("rule")) {
oReg=new Regex(oNode.SelectSingleNode("url/text()").Value);
Match oMatch=oReg.Match(zPath);
if(oMatch.Success) {
return oReg.Replace(zPath,oNode.SelectSingleNode("rewrite/text()").Value);
}
}
return zPath;
}
public static void Process() {
Rewriter oRewriter=(Rewriter)ConfigurationSettings.GetConfig("system.web/urlrewrites");
string zSubst=oRewriter.GetSubstitution(HttpContext.Current.Request.Path);
if(zSubst.Length>0) {
HttpContext.Current.RewritePath(zSubst);
}
}
#region Implementation of IConfigurationSectionHandler
public object Create(object parent, object configContext, XmlNode section) {
_oRules=section;
// TODO: Compile all Regular Expressions
return this;
}
#endregion
}
}
---------
Have you considered using the IIS7 URL Rewrite Module [learn.iis.net]?