Home > Back-end >  Presta Shop: new (second) copy of shop keeps redirecting to old domain
Presta Shop: new (second) copy of shop keeps redirecting to old domain

Time:03-02

I'm using standard presta shop intalation. Then I've made a copy (DB and FTP files) and setup a new subdomain pointing to it to provide myself test evn. But all http requests on my new test subdomain are still redirected to main domain.

I'm loking for a cause. Maybe it is a .htaccess problem (code below). In the end, when I'm entering my new instance of presta shop (http://tst-shop.mydomain.com) I don't want if to redirect me to main/old domain. How to do that?

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on


RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api$ api/ [L]

RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9] )?/. \.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]

CodePudding user response:

First of all check your copy for database entries in ps_shop_url table and fix "domain" and "domain_ssl" values to reflect your staging subdomain.

If your staging copy is in a subfolder, update the "physical_url" value from "/" to the subfolder name (do not forget the trailing slash in case - Ie. /subfolder/ )

Then go in backoffice, "Seo&Url" section and save the configuration once to regenerate a clean .htaccess with updated paths.

  • Related