URL Rewriting

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 14 años
Hi,
How can I remove the ID and the .aspx from the link?

thx
Hace 14 años
You will need to keep the ID, but you can remove the .aspx;

please goto Administration > Configuration > Global Setting >SEO/Display

Change your URLrewrite to something like : {0}Products/{1}/{2}

You will also need to update URLrewrite.config

Do this: ^~/Products/([0-9]*)/([\w-]*)

and your URL should look like: http://Whatever.com/Products/1/Mikes-Biography

mike..
Hace 14 años
Hey Mike,
thank you for your reply.
I tried your way, but after I removed the .aspx, I got the 'page not found' error.
Hace 14 años
Please make sure you have changed the NopCommerceStore/URLrewiting.config like so:


<add name="ProductDetailsRewrite" virtualUrl="^~/Products/([0-9]*)-([\w-]*)"
         rewriteUrlParameter="ExcludeFromClientQueryString"
         destinationUrl="~/Product.aspx?ProductID=$1&amp;$3"
         ignoreCase="true" />


Thanks, mike..
Hace 14 años
I did, I removed the .aspx.. from the urlrewriting.config file
Hace 14 años
Hey Mike, still giving the same error
Hace 14 años
Woops made a mistake:

<add name="ProductDetailsRewrite" virtualUrl="^~/Products/([0-9]*)/([\w-]*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/Product.aspx?ProductID=$1&amp;$3"    ignoreCase="true" />


if you have done as I said it should work, have you changed it in administration?

mike
Hace 14 años
Hey Mike,
No luck so far. Here's what I did:

in the administration:
{0}Products/{1}/{2}

in urlrewriting.config:
<add name="ProductDetailsRewrite" virtualUrl="^~/Products/([0-9]*)/([\w-]*)"
         rewriteUrlParameter="ExcludeFromClientQueryString"
         destinationUrl="~/Product.aspx?ProductID=$1&amp;$3"
         ignoreCase="true" />


Error when the link is: /Products/63/best-grilling-recipes
Works when I add .aspx: /Products/63/best-grilling-recipes.aspx

Sorry to bother with that...
Joe
Hace 14 años
Sorry my mistake, hecktic day going on holiday tonight!

if you have access persuming on iis7 you will need to pass all values throught ASP.NET ISAPI extension so you will need to set this Application extension mapping.

if with a hosting company you will need to ask them for assistance.

hope this helps.

mike..
Hace 14 años
thank you for your help
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.