Site icon PrestaShop | Magento | CRM Modules

PrestaShop how to set 301,404,50,0 and other redirects from .htaccess file

You can set up redirects for different HTTP status codes in PrestaShop using the .htaccess file. Here’s how you can do it:

1. Edit the .htaccess file

2. Add Redirect Rules

Below are examples of redirect rules for different status codes:

301 Permanent Redirect (Moved Permanently)

Redirect 301 /old-page.html https://www.presta-addons-modules.com/en/seo/prestashop-seo-automatic-google-rich-snippets-json-ld-opengraph-twitter-tags-schemaorg.html

302 Temporary Redirect

Redirect 302 /temporary-page.html https://www.presta-addons-modules.com/en/seo/prestashop-seo-automatic-google-rich-snippets-json-ld-opengraph-twitter-tags-schemaorg.html

404 Redirect (Page Not Found)

ErrorDocument 404 https://www.presta-addons-modules.com/en/seo/prestashop-seo-automatic-google-rich-snippets-json-ld-opengraph-twitter-tags-schemaorg.html

500 Redirect (Internal Server Error)

ErrorDocument 500 https://www.presta-addons-modules.com/en/seo/prestashop-seo-automatic-google-rich-snippets-json-ld-opengraph-twitter-tags-schemaorg.html

Redirect All Non-Existing Pages to a Custom Page

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* https://www.presta-addons-modules.com/en/seo/prestashop-seo-automatic-google-rich-snippets-json-ld-opengraph-twitter-tags-schemaorg.html [R=301,L]

3. Save and Upload

4. Clear Cache

Bonus Tip: Managing Redirects from PrestaShop Admin

If you prefer not to edit .htaccess Manually, you can use an SEO module like SEO & URL Redirect Manager or an SEO-friendly 301 Redirect Module from the PrestaShop Addons Marketplace.

Would you like help with automatic redirects for SEO optimization in PrestaShop? 🚀

Exit mobile version