Jump to content

htaccess redirect


geogeng

Recommended Posts

I saw this on other website and i need help with something similar 

At the moment, I'm using the default Prestashop structure:

{category:/}{id}-{rewrite}{-:ean13}.html

Which produces the following links:

http://www.sitename.com/category/123456-product-name-0123456789123.html

I'm now looking at changing it to the following structure (which I think might be more efficient because you can find the same words on category and product names):

{rewrite}-{id}-{:ean13}

Which would produce this kind of link:

http://www.sitename.com/product-name-123456-0123456789123

But now I don't really know how to handle the change, if it can even be done easily?

 

Using a RedirectMatch directive from mod_alias in your .htaccess file should do the trick:

RedirectMatch permanent /[^/]+/([0-9]+)-(.*)-([0-9]+)\.html$ /$2-$1-$3

This pulls out the matching parts of your old URLs and redirects them to the new format.

 

My previous product seo was {manufacturer:/}{id}-{rewrite} and now its {category:/}{rewrite}-{id}

How do i redirect it in htaccess?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...