0

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

4 Answers 4

5

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.

1
  • The virtualhost is configured to listen at example.me, that's what domain and domain_ssl have. BTW, I can't access panel, so I changed them directly in database
    – K. Weber
    Jan 12, 2017 at 16:05
1

Do what @sarcom said and after that delete your htaccess file, go to backoffice, disabled Friendly URL and that should be all.

Good luck.

9
  • Still the same problem. I can't access panel, I get PHP error PHP Fatal error: Uncaught Error: Call to undefined function simplexml_load_file(), maybe related?
    – K. Weber
    Jan 12, 2017 at 16:07
  • Of course is related. Check your hosting PHP version. That function is from PHP 5 and PHP 7. Anyway this function should be used to download Prestashop updates notification, so if you can find the line you could comment on source code. Good luck.
    – PrestaAlba
    Jan 12, 2017 at 16:10
  • I have PHP 7 in localhost, I can see this problem here, but this doesn't solve the redirection issue: stackoverflow.com/a/36407094/761076
    – K. Weber
    Jan 12, 2017 at 16:14
  • 1
    You should do what @sarcom said. You could do it accessing backoffice in Preferences -> SEO & URL menu.
    – PrestaAlba
    Jan 12, 2017 at 16:19
  • Phewww, done!, there seem to be a lot of issues with this prestashop version (1.5) and php 7, in fact my current task is upgrade version
    – K. Weber
    Jan 12, 2017 at 16:28
1

How to move PrestaShop 1.7.2.3 to another domain

Changing the PrestaShop URL 1.7.2.3

Migrating PrestaShop 1.7+

  1. Firstly clear your cache. short movie
    • Go to zzz.com/admin
    • choose advanced parameters from left menu
    • than choose Performance
    • click Clear cache in the top right corner
  2. Create new domain on your server
  3. Eksport your database to zzz.sql in phpMyAdmin
  4. Open zzz.sql file, find and replace your domain e.q. zzz.com to ggg.com
  5. navigate to old shop's path
    • cd home/zzz.com/public_html/
  6. copy all files
    • cp -R public_html ../ggg.com
  7. navigate to new shop's path
    • cd home/ggg.com/public_html
  8. setup permissions for directories
    • sudo find . -type d -exec chmod 755 {} “;"
    • sudo find . -type f -exec chmod 644 {} ";"
  9. setup correct user owner for files www-data. Cause now it can be a root
    • go to public_html: cd home/ggg.com/public_html
    • chown -R www-data:www-data .
  10. open to phpMyAdmin
    • create new db ggg
    • import zzz.sql file
  11. Edit database_name variable directory from zzz to ggg in below files.
    • home/ggg.com/public_html/app/config/parameters.php
    • home/ggg.com/public_html/app/cache/dev/appParameters.php
    • home/ggg.com/public_html/app/cache/prod/appParameters.php
  12. DONE!
0

ps_shop_url (Change table prefix 'ps' to the one you have). Changing this corrected my Prestashop 1.6 version installation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.