PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 27, 2022

[FIXED] How to create 301 or 302 redirect in PrestaShop 1.7?

 October 27, 2022     .htaccess, prestashop, prestashop-1.7, seo, url-redirection     No comments   

Issue

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?


Solution

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 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



Answered By - marsaldev
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing