Difference between revisions of "301 URL Redirect Pages for AbleCommerce"
m |
m |
||
Line 4: | Line 4: | ||
For example if you have some blah.aspx product page which is not working in AbleCommerce 7 because AbleCommerce seven uses some different URL for that page. You can solve this problem by creating a 301 Redirect page for your AbleCommerce store in the following way. | For example if you have some blah.aspx product page which is not working in AbleCommerce 7 because AbleCommerce seven uses some different URL for that page. You can solve this problem by creating a 301 Redirect page for your AbleCommerce store in the following way. | ||
− | |||
− | |||
− | |||
− | |||
private void Page_Init(object sender, System.EventArgs e) | private void Page_Init(object sender, System.EventArgs e) | ||
{ | { | ||
Line 19: | Line 15: | ||
Response.End(); | Response.End(); | ||
} | } | ||
− | + | ||
Just provide your new URL in place of "New URL Here" in the above function. For example | Just provide your new URL in place of "New URL Here" in the above function. For example | ||
string redirectLocation = "yourstoreurl/someproduct.aspx"; | string redirectLocation = "yourstoreurl/someproduct.aspx"; |
Revision as of 16:20, 23 July 2008
301 redirect is an efficient and Search Engine Friendly method for redirecting webpages. Its easy to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".
For example if you have some blah.aspx product page which is not working in AbleCommerce 7 because AbleCommerce seven uses some different URL for that page. You can solve this problem by creating a 301 Redirect page for your AbleCommerce store in the following way.
private void Page_Init(object sender, System.EventArgs e)
{
string redirectLocation = "New URL Here";
Response.Clear();
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location", redirectLocation);
Object Moved
This object may be found at <a href=\"{0}\">{0}</a>.</body></html>";Response.Write(string.Format(pageContent, redirectLocation)); Response.End(); }
Just provide your new URL in place of "New URL Here" in the above function. For example
string redirectLocation = "yourstoreurl/someproduct.aspx";