Jump to content

Domain redirect after copy on same server.


Recommended Posts

Good day,

 

 

Hopefully someone can help me on fixing this issue. And let me add that i searched internet an presta forum extensively before posting here.

 

Firstly please let me explain the situation exactly.

 

I want to use my current working prestashop 1.6.0.14 webshop as a template for other webshops that i am creating.

 

So i used the steps to move the domain to another domain on the same server.

 

Domain 1 will keep working and a copy of domain 1 will be working as a new domain on the same server.

 

these are the steps i took. 

 

Moving PrestaShop to a New Domain
 
Here are the main steps when moving PrestaShop to a new domain within the same server. 
1. Put your shop in maintenance mode, so as to not lose new customers or orders will moving the data.
Go to your back-office, and under the "Preference" menu, open the "Maintenance" page and set the "Enable shop" option to "No".
2. Copyed the files to the new webroot for the new domain
2a Made an sql dump of the original database.
2b Created a new database added a new database user and imported the sql dump into the new database 
 
3 Configuration. On the new domain edited the /config/settings.inc.php file and updated the settings to the new database information:
 
define('_DB_SERVER_', 'localhost');
define('_DB_NAME_', 'newprestashopdbname');
define('_DB_USER_', 'new-ps-user');
define('_DB_PASSWD_', 'new-presta-pass');
define('_DB_PREFIX_', 'ps_');
 
The above details are not real. But it is just to show that i created a new user and database and i am using this new database with the edited details in settings.inc.php on the new domain.
 
 
b. Logged into the back-office, At "Preferences" menu, selected the "SEO & URLs" page, and in the "Set shop URL" section change the domain name to the new domain. Did the same for the SSL domain.
In effect, this will update the "PS_SHOP_DOMAIN" and "PS_SHOP_DOMAIN_SSL" rows in the "ps_configuration" SQL table.
 
4. Deleted everything except the index.php files in the following folders:
/prestashop/cache/smarty/cache
/prestashop/cache/smarty/compile
 
In the back-office "Maintenance" preference page, set the "Enable shop" option back to "Yes".
 
 
So now it works. When i go to the new domain name it works for a while an suddenly it will switch to the other live domain on the server.
 
I double checked in the datbase for "PS_SHOP_DOMAIN" and "PS_SHOP_DOMAIN_SSL" and these are also pointing to the correct domain.
 
Some extra info.
At the domain registrar there is no redirect addded (domain point just to my server ip).
 
 
 
P.s.
The only thing i can think about is that the coockie key for both domains is the same because op de 1:1 copy (might have noting to do with it).
 
 
Any suggestions where to start or check ?
 
 
Regard,
 
Bernhard.
Link to comment
Share on other sites

Hi frontend,

 

I sometimes have a test site to play with, and the real site, that has the stable version. On the real site, there are some modules that have links that include the full domain name in the path, so whenever I am on the test site and click those links, I end up on the main site. Can it be that here the same is true? Do you have some links on (some of) your pages that link to the main site (let's call your "other live site" it switches to  the  "main site")?

 

Is there any consistency in the time or moment the site moves to the main site? Is it after a click, or suddenly refreshes and comes to the main site? Please try to find some patterns, or if you want, Private Message (PM) me the two sites and I can have a look if I can repeat it here)

 

pascal.

Link to comment
Share on other sites

frontend,

Did you :

 

- temporarily turn ON force compilation and turn OFF smarty Cache and other cache types on theAdvanced Parameters->Performance page?

- clear your browser cache and cookies?

 

Strange symptom,  seems pretty random when it happens... Do you have a cache (like google mod_pagespeed, APC etc running on your site? Maybe turn it off for a moment and see if that helps.

 

My 2 cents,

pascal.

Link to comment
Share on other sites

Hi Pascal,

 

Yes, You made a very good suggestion. I was able to narrow it down to the APC caching system. When i turned it off on the second website the redirecting issue dissapears.

 

In the past i have experimented extensively to build a high performance server for hosting prestashop websites. Prestashop was tested With different caching systems to give lightning speed webpage loading times. In my opion Prestashop needs a rather heavy server platform to give a good user experience. In this i succeeded when you look at the scores below while considering these score are based on worldwide high speed server comparison.

 

Tested from Amsterdam, Netherlands on April 30 at 01:24:15

Page size 249.9kB
Load time 619ms
Requests 87 (24 products on the main page)
Perf. grade 86/100

Your website is faster than 95% of all tested websites 

 

I am not yet sure what might be the reason APC produces these errors (still might be the coockie key?). Any way now it wil be easier to investigate the issue.

 

On the second website i have enabled memcached for the time being to do the same job.  When i find out what is actually the issue with APC i will let you know. 

 

Thanks so far Pascal.

Edited by frontend (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...