Being a popular e-commerce platform, it is very common for store owners to want to migrate to nopCommerce for its powerful features.
One common problem developers face is to migrate old, existing links (from some other e-commerce platforms) to new links (nopCommerce). Especially for old sites which are already getting tons of traffics and are having very good SEO rankings, it is very important to make sure the old URLs are 301-redirected to new nopCommerce URLs.
If it's static URLs (e.g. those for content pages), you can already use IIS URL Rewrite to do the migration manually. But the problem arises when it comes to product and category urls. Because the URLs are dynamic (and there are tons of those URLs), it is usually impractical to manually add URL Rewrite entries one-by-one.
Take the following URLs for example:
- http://oldsite.com/product-slug-one-p1234.htm
- http://oldsite.com/product-slug-two-p4567.htm
- http://oldsite.com/category-slug-one-c12.htm
- http://oldsite.com/category-slug-two-c34.htm
If you look at the URLs, they are pretty dynamic. Product URLs follow a pattern of {product-slug}-p{product-id}.htm. Category links also follow a similar pattern.
And to make the problem worse (which happens very often), old product IDs (and category IDs) do not correspond to new product IDs. That means in old system, product ID 1234 is product ID 4321 in new system.
So the question now is - how can we make sure old URLs, such as http://oldsite.com/product-slug-one-p1234.htm, will be 301-redirected to new nopCommerce URLs, such as http://nopcommercesite.com/product-one-new-slug?