0

I want covert aspx page into html at runtime for SEO.

like example localhost:45556/index.aspx => localhost:45556/index.html

Unheilig
  • 16,196
  • 193
  • 68
  • 98

3 Answers3

0

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

Tony Gustafsson
  • 828
  • 1
  • 7
  • 18
0

You could use the IIS Rewrite Module like described in this post:

Remove HTML or ASPX Extension

and change the match URl criteria to

<match url="(.*).html" />

and change the action to the following

<action type="Rewrite" url="{R:1}.html" />
Community
  • 1
  • 1
w33z33
  • 378
  • 2
  • 17
0

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");
    }
}