SEO.Product.UrlRewriteFormat in 2.4

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hello.
Anyone knows where ican I change the format of SEO.Product.UrlRewriteFormat in 2.4?.
I want to upgrade my cart from 1.2 and i don't want to lo lose my SEO positioning due to diferent URL rewriting format.
Regards.
12 years ago
In 2.X, the product URLs are now configured in the source file: Presentation\Nop.Web\Infrastructure\RouteProvider.cs

Find the following code to update the product URL (modify the underlined line -keep {productId} in the URL):
//products
routes.MapLocalizedRoute("Product",
                "p/{productId}/{SeName}",
                new { controller = "Catalog", action = "Product", SeName = UrlParameter.Optional },
                new { productId = @"\d+" },
                new[] { "Nop.Web.Controllers" });

Since you modified the URLs in your 1.X version, you will need to update the old URL in the following file:
Presentation\Nop.Web\Infrastructure\UpgradeRouteProvider.cs
//products
routes.MapRoute("", "products/{id}.aspx",
                new { controller = "BackwardCompatibility1X", action = "RedirectProduct"},
                new[] { "Nop.Web.Controllers" });

You will need the source version of 2.40 as you will need to recompile the solution.

.
12 years ago
Thank you.
I did not modify the URL in my 1.2 version.
This is an example of my url in 1.2 version:
http://www.e-wirelesslan.com/Products/94-venta-antenas-omnidireccionales-wifi-hg2408u-nf.aspx
and in 2.4 the URL looks like this:
http://localhost:15973/p/12/asus-eee-pc-900ha-89-inch-netbook-black

Do I need to change samething or nopcommerce do it automaticly.
And i have to, how do i recompile, i'm new in asp.net.
Regards.
12 years ago
If you didn't modify the 1.20 URL format, then you don't need to update the URL format in 2.40. Old URLs will automatically be redirected to the new URL.

For example, after updating to 2.40, requests for the URL:
http://www.e-wirelesslan.com/Products/94-venta-antenas-omnidireccionales-wifi-hg2408u-nf.aspx

would be redirected (via HTTP code 301) to:
http://www.e-wirelesslan.com/p/94/venta-antenas-omnidireccionales-wifi-hg2408u-nf

.
12 years ago
Thank you so much.
It is great that nopcommerce take care of 301 redirection whiout tuching anything.
Great job!!!!.

Regards.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.