Antarr Posted August 7, 2016 Share Posted August 7, 2016 I have old domain OLD.COM and recently bought a new one - NEW.COM which now should be the main name of the site while old name OLD.COM should be the alias with redirection to the main site. there's Apache configuration^ <VirtualHost 8.8.8.8:80> ServerName OLD.COM ServerAlias www.OLD.COM Redirect permanent / https://NEW.COM/ </VirtualHost> <VirtualHost 8.8.8.8:80> ServerName NEW.COM ServerAlias www.NEW.COMm Redirect permanent / https://NEW.COM/ </VirtualHost> <VirtualHost 8.8.8.8:443> ServerName NEW.COM ServerAlias OLD.COM www.OLD.COM www.NEW.COM DocumentRoot /usr/local/www/data/ftp/www/old.com ... ... </VirtualHost> I'm trying to add theese lines to a top of my .htaccess file: RewriteCond %{HTTP_HOST} ^(www\.|)OLD\.COM$ [OR,NC] RewriteRule ^(.*)$ https://NEW.COM/$1 [R=301,L] but got error: Too many redirects... What could be the problem? Link to comment Share on other sites More sharing options...
Shopboy1111 Posted August 7, 2016 Share Posted August 7, 2016 Did you change the domain name in the settings ? Link to comment Share on other sites More sharing options...
Antarr Posted August 7, 2016 Author Share Posted August 7, 2016 Of course. There's new domain name. Link to comment Share on other sites More sharing options...
Shopboy1111 Posted August 7, 2016 Share Posted August 7, 2016 DOCUMENTATION (YOU MAY HAVE ALREADY FOLLOWED) Moving PrestaShopA PrestaShop installation does seldom remain at the same physical place. There are many reasons why you would need to move your PrestaShop files and data around: Moving your shop from your local computer to your online server. Moving your shop from a test sub-domain to the main domain. Moving your shop from one server to another. Moving your shop from one domain name to another. In all of these circumstances, you must be careful to properly move both all of your files (including the custom images, your themes, the modules you bought...) and all your data (which is contained in your MySQL database). Moving PrestaShop to a New ServerHere are the main steps when changing servers, or copying from your local hard-drive to your online server: Put your shop in maintenance mode, so as to not lose new customers or orders while 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". Move your files: Make a backup of all the files: connect to your FTP server, and copy all the files and folders to your local hard-drive. Transfer your files to your new host: Connect to the FTP server for your new host, and copy all the files and folders that you just downloaded to your local hard-drive, as is. Move your data: Make a backup of you database (a "dump"): connect to phpMyAdmin, click on the "Export" tab, select the database of your PrestaShop installation, and click the "Go" button. Save the downloaded file on your hard-drive. If phpMyAdmin times out before it is able to export all your data, contact your host. Transfer the SQL dump to the new database: connect to the new server's phpMyAdmin, click on the "Import" tab, click the "Browse..." button, find the SQL file you just downloaded, and click the "Go" button to upload it. If phpMyAdmin times out before it is able to import all your data, contact your new host. Configure your shop: On the new server, open the /config/settings.inc.phpfile and update the settings for the new database server (with your own settings instead of the examples here): define('_DB_SERVER_', 'sql.domainname.com'); define('_DB_NAME_', 'prestashop'); define('_DB_USER_', 'PS-user'); define('_DB_PASSWD_', 'djsf15'); define('_DB_PREFIX_', 'ps_'); Log in to your back office, go to the "Preferences" menu, select the "SEO & URLs" page, and in the "Set shop URL" section change the domain name to your new domain. Do the same for the SSL domain. In effect, this will update the "ps_shop_url" SQL table (as well as the "PS_SHOP_DOMAIN" and "PS_SHOP_DOMAIN_SSL" rows in the "ps_configuration" SQL table, for retrocompatibility reasons). Connect to your new FTP server and delete everything except the index.phpfiles in the following folders: /cache/smarty/cache /cache/smarty/compile Go to your back office, and in the "Maintenance" preference page, set the "Enable shop" option back to "Yes". You should be good to go! Check that all the links are functioning, that all your products, images, modules and themes are still there, and try to create a new account and place an order so as to make sure your shop is working as expected. Moving PrestaShop to a New DomainHere are the main steps when moving PrestaShop to a new domain within the same server. These are mostly a simpler version of the above steps – we do not touch the data, which stays on the same MySQL server. 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". Move your files Make a backup of all the files: connect to your FTP server, and copy all the files and folders to your local hard-drive. Transfer your files to your new host: Connect to the FTP server for your new host, and copy all the files and folders that you just downloaded to your local hard-drive, as is. Configuration On the new server, open the /config/settings.inc.php file and update the settings for the new database server (with your own settings instead of the examples here): define('_DB_SERVER_', 'sql.domainname.com'); define('_DB_NAME_', 'prestashop'); define('_DB_USER_', 'PS-user'); define('_DB_PASSWD_', 'djsf15'); define('_DB_PREFIX_', 'ps_'); Log in to your back office, go to the "Preferences" menu, select the "SEO & URLs" page, and in the "Set shop URL" section change the domain name to your new domain. Do 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. Connect to your new FTP server and delete everything except the index.phpfiles in the following folders: /tools/smarty/cache /tools/smarty/compile /tools/smarty_v2/cache /tools/smarty_v2/compile Go to your back office, and in the "Maintenance" preference page, set the "Enable shop" option back to "Yes". You should be good to go! Check that all the links are functioning, that all your products, images, modules and themes are still there, and try to create a new account and place an order so as to make sure your shop is working as expected. Link to comment Share on other sites More sharing options...
Antarr Posted August 7, 2016 Author Share Posted August 7, 2016 (edited) I'm not moving any files nowhere. All files remain the same in the same place - on the old server in the old directory. I'm just adding new domain (new name of the site: https://en.wikipedia.org/wiki/Domain_name ) as a main domain while old domain remains the alias. Edited August 7, 2016 by Antarr (see edit history) Link to comment Share on other sites More sharing options...
Antarr Posted August 10, 2016 Author Share Posted August 10, 2016 Hello? No ideas? May be I should use multidomain if this feature doesn't work? Link to comment Share on other sites More sharing options...
Shopboy1111 Posted August 11, 2016 Share Posted August 11, 2016 (edited) Sorry but I am out of suggestions - sounds like to need to approach the Prestashop Support Team directly Edited August 11, 2016 by Shopboy1111 (see edit history) Link to comment Share on other sites More sharing options...
electriz Posted August 12, 2016 Share Posted August 12, 2016 (edited) Hmmm maybe you should try to disable/enable friendly URL to rebuild .htaccess file. Please also check manually if in ps_shop_url table if there is your new domain. Have a look at ps_configuration table where name is PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL. If everything is set correctly, I think it may be problem not with Presta but with domain assignment. Edited August 12, 2016 by electriz (see edit history) Link to comment Share on other sites More sharing options...
Antarr Posted August 12, 2016 Author Share Posted August 12, 2016 Have a look at ps_configuration table where name is PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL. There's localhost and 192.168.1.27 values. Where I can set them? Link to comment Share on other sites More sharing options...
electriz Posted August 12, 2016 Share Posted August 12, 2016 There's localhost and 192.168.1.27 values. Where I can set them? Do you have phpMyAdmin? Or how did you preview this? Link to comment Share on other sites More sharing options...
Antarr Posted August 12, 2016 Author Share Posted August 12, 2016 Yes. Via phpMyAdmin. I would like to know how they are set by Back Office settings. Link to comment Share on other sites More sharing options...
electriz Posted August 12, 2016 Share Posted August 12, 2016 Yes. Via phpMyAdmin. I would like to know how they are set by Back Office settings. You have it in the first post (Preferences > SEO & URL). It should do the job. Link to comment Share on other sites More sharing options...
Antarr Posted August 12, 2016 Author Share Posted August 12, 2016 You kidding? I said there're right values in the third comment here: https://www.prestashop.com/forums/topic/547587-how-i-can-redirect-to-a-new-domain/?do=findComment&comment=2380602 Link to comment Share on other sites More sharing options...
electriz Posted August 12, 2016 Share Posted August 12, 2016 You kidding? I said there're right values in the third comment here: https://www.prestashop.com/forums/topic/547587-how-i-can-redirect-to-a-new-domain/?do=findComment&comment=2380602 No I'm not. This should change all values, but if not I bet that's something wrong with your store. That's why I told you an alternative solution to edit it manually via database. Link to comment Share on other sites More sharing options...
Antarr Posted August 12, 2016 Author Share Posted August 12, 2016 Does not work. The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. And now, I got this error when I trying to go to the https://NEW.COM main page. So I need now to unset this RewriteRules. They does not work and we back to the start. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now