marquopolo Posted March 2, 2017 Share Posted March 2, 2017 Hello,With prestashop 1.6 catalog. The owner asked to change the domain name of the site but wanted to keep the old one for legacy purpose... so www.olddomain.com became www.newdomain.com We did a rewriterules :RewriteRule ^(.+)/$ http://www.newdomain.com/$1 [R=permanent]This is working fine when typing "www.olddomain.com" it is converting to "www.newdomain.com" but if we try to access a specific link: "www.olddomain.com/index.php" this is what we get: "www.newdomain.comindex.php"and of course, error. The / is missing. I tried several version :^/(.+)$^(.*)/$^(.+)$always the same results! No / after the .com We use a vhost.conf file for all web site... There is also a .htaccess in the root of the prestashop website. Is there a conflict? This should be simple... changing a domain for another one. Any help? Link to comment Share on other sites More sharing options...
El Patron Posted March 2, 2017 Share Posted March 2, 2017 RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !newdomain.com$ [NC] RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301] I use this method to redirect all 'links' to new domain. Link to comment Share on other sites More sharing options...
marquopolo Posted March 2, 2017 Author Share Posted March 2, 2017 Hello, Thank you. I had to remove the RewriteBase so apache could restart. Now, it is working for any kind of link like: www.olddomain.com/index.php? but if it's "www.olddomain.com" that should redirect to "www.newdomain.com" it is ratter doing: www.newdomain.com// and showing an error message 404 because of 2 trailing slash ! ?? Do you have a clue? Thanks! Link to comment Share on other sites More sharing options...
El Patron Posted March 2, 2017 Share Posted March 2, 2017 check back office-->preferences-->seo & urls domain name domain name ssl make sure no trailing slash Link to comment Share on other sites More sharing options...
marquopolo Posted March 2, 2017 Author Share Posted March 2, 2017 No... no trailing slash. but in the 3rd field below, there is a / and nothing else. When i try to remove and save, prestashop puts it back in the field. So I have: newdomain.com newdomain.com (ssl) / ? Thanks Link to comment Share on other sites More sharing options...
El Patron Posted March 3, 2017 Share Posted March 3, 2017 No... no trailing slash. but in the 3rd field below, there is a / and nothing else. When i try to remove and save, prestashop puts it back in the field. So I have: newdomain.com newdomain.com (ssl) / ? Thanks where you tried to remove slash tells ps where files are, in this case root '/'. if you installed in folder it would have folder name. no need to change this...lol without access I'd not dare to guess your // issue. For rewrite rules google in general and not specificlly for PrestaShop as this is sever specific and not really PS specific. Link to comment Share on other sites More sharing options...
marquopolo Posted March 3, 2017 Author Share Posted March 3, 2017 Hi, Well the exact same rewrite rules on standard PHP web sites work well... so there must be something specific with Prestashop. I just removed all redirection rules from apache vhost.conf and the incredible thing is that le old domain STILL is being redirected to the new one!!!!! I have cheched the .htaccess file in the root of the prestashop site and no reference of the olddomain! I am completely lost! Thanks for your time. 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