Ad

How To Create 301 Or 302 Redirect In PrestaShop 1.7?

I have a Prestasop 1.7 based store. I changed a product URL. People can find this product from Google. But they can't access the product page, because the product page URL has changed. So I need to add 301 redirect rule for old URL to new URL. How can I do that?

Ad

Answer

You have two ways to do that, edit the .htaccess (if you have apache based web server) or to install a module.

If you choose the .htaccess, create a 301 redirect is quite simple, here an example:

<ifModule mod_rewrite.c>
    Redirect 301 /old-cat/old-url.html http://www.youdomain.com/new-cat/new-url.html
</ifModule>

Insert this rule before the rules of PrestaShop. More info here

The other way, the module, you can install a module like here

The other way, the module, you can install a module like this that simplify the operation.

UPDATE: Like @Agah Toruk says

It's a better option to disable the product and create the same product as a new product instead of changing the product URL. In this way, you can redirect the old product to the new product in product editing page easily.

Redirection settings in product editing page

Enojoy

Ad
source: stackoverflow.com
Ad