I want covert aspx page into html at runtime for SEO.
like example localhost:45556/index.aspx => localhost:45556/index.html
I want covert aspx page into html at runtime for SEO.
like example localhost:45556/index.aspx => localhost:45556/index.html
Google wouldn't care if it's aspx or html. The more important part is that the domain name tells something about what the site is about, and the URL path tells something about the page you are on.
www.domain.com/shirts/tshirts/green/ is a better URL than www.domain.com/prodId=3999944
You could use the IIS Rewrite Module like described in this post:
and change the match URl criteria to
<match url="(.*).html" />
and change the action to the following
<action type="Rewrite" url="{R:1}.html" />
You can do this in c#.NET to change the .aspx to .html
Please put this code in your Global.asax file.
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
if (app.Request.Path.ToLower().IndexOf(".html") > 0)
{
string rawpath = app.Request.Path;
string path = rawpath.Substring(0, rawpath.IndexOf(".recon"));
app.Context.RewritePath(path+".aspx");
}
}