Forum Moderators: open
Recently i have register a domain and space in Go daddy under "Windows Plan".
Now my question is I want to solve "URL Canonicalization Issues for my domain".
What are steps to do to avoid the "canonicalization problem"?
I know to solve this issues by creating a permanent redirection using 301 redirect in .htaccess for Linux server.
But how to do with Windows Server.
Thanks in Advance
If this is also not the case you can implement your own simple redirect method within the BeginRequest method in the Global.asax.
void Application_BeginRequest(object sender, EventArgs e)
{
if (!HttpContext.Current.Request.Url.AbsoluteUri.ToLower().StartsWith("http://www."))
{
string newUrl = HttpContext.Current.Request.Url.AbsoluteUri.ToLower().Replace("http://", "http://www.");
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location", newUrl);
}
}
canonical: reduced to the simplest and most significant form possible without loss of generality
the "canonical solution" is to provide a 301 redirect to the canonical url, in which case the link element is redundant.
<rule name="Convert to lower case" stopProcessing="false">
<match url=".*[A-Z].*" ignoreCase="false"/>
<conditions>
<!-- The following condition prevents rule from rewriting requests to .axd files -->
<add input="{URL}" negate="true" pattern="\.axd$"/>
</conditions>
<action type="Redirect" url="{ToLower:{R:0}}" redirectType="Permanent"/>
</rule>
One method I used in the past was to rename the default.aspx to anyfilenamewhatever.aspx and set that file/default document as first on the list on Documents Tab in IIS.
Then never link to that file in the code.
No one can link-to/try-to-hack the file if they don't know the name of the file, no matter wHat cASe iT's in, right?
One method I used in the past was to rename the default.aspx to anyfilenamewhatever.aspx and set that file/default document as first on the list on Documents Tab in IIS.
This is also a good option, just make sure that the form action= doesn't point to the filename. You can change that with:
Form1.Action = "/path/to/page/";* this only works with ASP.net 3.5 SP1