Top Question Answers about PrestaShop URL Redirect Module

URL redirect has now become an essential task for most of the merchant. They need to redirect their shops for many of the purposes;

·         When a site needs maintenance, merchants have to redirect it to other domain for short period of time

·         When a store is completely shut down and shifter to another domain

·         When merchants want to redirect from http to https server

·         When merchants have to redirect non-www to www protocol.

·         When a merchants migrate from others shopping carts to PrestaShop

By default, PrestaShop has not easy options to redirect URLs, so this task can be done by two methods

·         Editing the htaccess file to redirect

·         Use a PrestaShop redirect module

Here our topic is not related to defining the way to redirect but we will confine to some common problem and their solution related to PrestaShop redirect. So given here Top Question Answers about PrestaShop URL Redirect;

Question No. 1: I am using PrestaShop 1.6.0.9 and I have multistore enabled. I have migrated my shops from other shopping carts to PrestaShop. So I want to 301 redirect all my product and categories so that Google will index my new urls keeping intact my old ranking. Is it possible through adding redirects through htaccess file or it follows some other formula?

Answer:  It can be done through php files instead of htaccess. Just create a file named “old_sit_redirect.php and paste the following code in it. Here you have to OLD url and new URL as per your own urls.

$url_redir_maps = array(

'/some_old_url.html' => '/some_new_url',

'/old_url2' => '/new_url2',

(...and so on)

);

if(in_array(@$_SERVER['REQUEST_URI'], array_keys($url_redir_maps))){

header("HTTP/1.1 301 Moved Permanently"); 

header("Location: ".$url_redir_maps[@$_SERVER['REQUEST_URI']]);

exit;

}

Question No. 2: Hi, I am using default PrestaShop module for redirect but the header that it is generating is totally wrong. The URLs is with the header https but when it redirects, it goes to http version.

Answer: Try to paste the exact url before passing it to Tools::redirect() function and then see that either it is redirecting to http or https. However, the point to be noted is that this PrestaShop function can’t do such task of changing the version from https to http. It may be problem with the redirecting url.

Question No. 3: I have migrated my store from another shopping cart to PrestaShop and I want to redirect the old ULRs to new URLs. When I redirect, old pages are not correctly redirecting to new urls. The reason of this issue is that I am not using www in start. I am not using it because If I will use it, I am unable to login to my store. Also, in this way my customers can’t login to their accounts. How can I solve this issue?

Answer: To solve this issue of www and non-www, you have to include following code at the top of your htacccess.

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www.

RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Question No. 4: I have shifted my old shopping cart to PrestaShop and I want to redirect all my old urls to new one so that I can avoid the 404 error for those old pages that are indexed by Google.

example

 

old site

http://www.xyz.com/acatalog/

 

new site

http://www.xyz.com

Answer: You can do by adding these lines in the htaccess file. It is the method of 301 redirect.

Options +FollowSymLinks

RewriteEngine on

RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Question No. 5: I am trying to redirect my urls in PrestaShop 1.5.4. I tried different methods of redirection through htaccess file by adding code after, before and inside but nothing solved the issue. As the old URLs are not redirecting to new urls correctly.

Answer: You have to place the following code at the top of index.php file.

if (strpos($_SERVER['REQUEST_URI'], OLD_URL_GOES_HERE) !== false) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: OLD_URL_GOES_HERE");
exit();
}

Question No. 6: I've installed a PrestaShop URL redirect module, but it doesn't seem to be working as expected. How can I troubleshoot and fix the redirection issues?

Answer: Check the module settings to ensure that the redirection rules are configured correctly. Verify that the old URLs and corresponding new URLs are accurate. Additionally, clear your shop's cache to ensure that the changes take effect. If the issue persists, review any error logs provided by the module for insights into potential issues.

Question No. 7: I'm running a seasonal promotion, and I want to temporarily redirect all traffic from my homepage to a special landing page. Can I set up temporary redirects using a PrestaShop URL redirect module?

Answer: Yes, you can typically set up temporary redirects using PrestaShop URL redirect modules. Check the module settings for options related to redirect types and choose a temporary (302) redirect for your seasonal promotion. Don't forget to revert the redirect settings once the promotion period is over.

Question No. 8: I've noticed a significant drop in my website's SEO ranking after implementing URL redirects. How can I ensure that my SEO is not negatively impacted during the redirection process?

Answer: Ensure that you're using 301 permanent redirects rather than temporary redirects. Search engines generally recognize and pass the SEO value of the old URLs to the new ones with permanent redirects. Additionally, regularly monitor your website's performance and update your sitemap to reflect the new URLs.

Question No. 9: I have a PrestaShop store with a blog section, and I want to implement URL redirects for my blog posts. Can I use a PrestaShop URL redirect module specifically for my blog URLs?

Answer: Yes, PrestaShop URL redirect modules allow you to create redirects for specific sections of your store, including blog URLs. 

Question No. 10: I have noticed that some old URLs are still appearing in search engine results even after implementing redirects. How can I expedite the removal of these outdated URLs from search engine indexes?

Answer: To expedite the removal of outdated URLs from search engine indexes, use the Google Search Console or equivalent tools. Submit a request to remove outdated URLs, and over time, search engines will update their indexes to reflect the new redirected URLs.

Note: These questions are answered by top community developers and do not reflect “FMEModules”