Search code examples
http-redirectprestashop

Prestashop keeps redirecting to old domain


I want to install a local replica of a Prestashop site, but when I enter local domain, it keeps redirecting me to old domain.

I downloaded files, downloaded and imported database, updated settings to point to local database, etc.

I updated ps_configuration table to set PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL to new local domain and disable (set to 0) all cache parameters in this table.

I edited .htaccess so all references to old domain get changed by new domain, and deleted all cookies and cache in browser. In short, I have the exact same problem than Prestashop redirects to old domain after changing it in Database but its solution doesn't work to me. Also, I restarted Apache, and still the same. A curl or the local site shows this info:

curl -v example.me
* Rebuilt URL to: example.me/
*   Trying 127.0.0.1...
* Connected to example.me (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: example.me
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 302 Found
< Date: Thu, 12 Jan 2017 15:40:56 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Vary: Host
< location: http://example.com/
< Content-Length: 0
< Content-Type: text/html; charset=utf-8
< 
* Connection #0 to host example.me left intact

Any ideas? Thanks


Solution

  • You have to update the ps_shop_url informations. There are two ways:

    From the backoffice

    Change your domain in Preferences -> SEO & URL.

    Directly into database

    – In ps_configuration change PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL to your new domain name, e.g. mydomain.com

    – In ps_shop_url table change ‘domain’, ‘domain_ssl’ fields to your new domain name. Change ‘physical_uri’ to your folder path, if you copied files into root folder, the path will be simply ‘/’.

    After that, remember to regenerate the .htaccess from the backoffice, Preferences -> SEO & URL as PrestaAlba sayd.