Reputation: 603
I am trying to create a copy of a prestashop 1.6 e-shop for development purposes from domain.com to dev.domain.com
The process I followed is
Now the problem is that when I open dev.domain.com i still get redirected to domain.com and I'm at a loss as to what to try next.
Searching for domain.com in phpmyadmin in the devdb doesn't yield results grep -ri 'domain.com' * doesn't yield results either in the files
Any suggestions what I can try next?
PS: domain.com and dev.domain.com are two different domains. Not similar in anyway
Upvotes: 10
Views: 19587
Reputation: 1
Comment lines from 469 to 472 in /classes/controller/FrontController.php section named "Automatically redirect to the canonical URL if needed"
Helped me. I did dozens of presta migrations and in one I had this problem like you. This helped me, I found in through debug mode.
Upvotes: 0
Reputation: 1
This is an old post but maybe someone will be helped
follow these steps : https://zemez.io/prestashop/support/how-to/prestashop-1-7-transfer-website-one-domain-another/
In parameters.php change the date also to actual
In config/defines.inc set define('PS_MODE_DEV', true); so admin panel will not be a blank page
Finish
Upvotes: 0
Reputation: 4338
For prestashop 1.7 you have to modify some values in the database:
More on https://blog.premium-templates.eu/how-to-move-prestashop-from-localhost-to-domain-or-vice-versa
Note: browsers cache redirections, you will have to clean your browser cache. Check https://www.getfilecloud.com/blog/2015/03/tech-tip-how-to-do-hard-refresh-in-browsers/ to know how to do a "hard refresh" for your browser.
Upvotes: 16
Reputation: 2789
Your procedure is right, there is only a few factors that may cause your issue
.htaccess
for Apache)Here are a few rudimentary scripts I use to automate the cache cleanup and domain change for Prestashop 1.7.
Use a template file to generate a .sql
file to patch the database. If more convenient, you can manually run that on your database directly.
patch-domain.sql.template
:
UPDATE ps_configuration SET value='${SHOP_DOMAIN}' WHERE name='PS_SHOP_DOMAIN';
UPDATE ps_configuration SET value='${SHOP_DOMAIN}' WHERE name='PS_SHOP_DOMAIN_SSL';
UPDATE ps_shop_url SET domain='${SHOP_DOMAIN}', domain_ssl='${SHOP_DOMAIN}';
Generate the real .sql
patch file, and apply it
$ export SHOP_DOMAIN=mydomain.com
$ envsubst < patch-domain.sql.template > patch-domain.sql
$ mysql -u <username> -p <database> < patch-domain.sql
Remove all cache files except index.php
clear-cache.sh
:
#!/bin/bash
base_dir='./shared/prestashop/html'
# Clear class index in case any override changed
rm ${base_dir}/cache/class_index.php
declare -a cache_dirs=(
"cache/smarty/compile"
"cache/smarty/cache"
"cache/cachefs"
"img/tmp" # You might want to keep tmp images
"themes/*/cache"
"var/cache")
# Clear all cache folder, ignoring 'index.php'
for dir in "${cache_dirs[@]}"
do
echo Cleaning ${base_dir}/${dir}...
find ${base_dir}/${dir} -type f ! -name index.php -delete
done
EDIT: The updated gist is accessible here
Upvotes: 3
Reputation: 87
Clear browser cache, nothing to see with this error, the real answer is change PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL in ps_configuration and ps_shop_url table
Upvotes: 0
Reputation: 72299
First of all it's great that you follow each step in correct manner. Now the problem is:-
When ever you are running any domain on your browser. Browser create cache and cookie for this. If you change any setting of your domain, it will not reflect till you not clear your browser cache and cookie completely.
So just remove your browser cache and cookie and try to check is it working or not.
Note:- Based on your process that you follow, this only problem seems to exist.
Upvotes: 3