websitenewbie Posted October 24, 2017 Share Posted October 24, 2017 I have build a website using Prestashop 1.7.1 and it's currently live. lets say for arguments sack the domain is www.domain.com. I have created a copy of the files and the DB and uploaded them to a new domain which is dev.domain.com. I have created a new DB and imported the tables into the DB and updated the log in credentials for this. I have also updated the url in the DB tables to dev.domain.com. My issue is when I enter dev.domain.com into the address bar it loads www.domain.com. I am trying to create this second site for development work. Please can someone help me, what have I missed? Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 24, 2017 Share Posted October 24, 2017 Change url in htaccess and in database, in ps_shop_url change domain and domain_ssl columns to proper one. After that visit the page using incognito mode because maybe your browser cached url redirection. On the end go to BO->Seo settings and generate SEO url again. Link to comment Share on other sites More sharing options...
websitenewbie Posted October 24, 2017 Author Share Posted October 24, 2017 Thanks hakeryk2. I have changed the Url in the DB using configuration table on both the url and the ssl field. However, when I enter dev.domain.com it redirects to www.domain.com Is there something else I need to do? Link to comment Share on other sites More sharing options...
bellini13 Posted October 24, 2017 Share Posted October 24, 2017 Your question was already answered... slow down and read the replies... Quote Change url in htaccess and in database, in ps_shop_url change domain and domain_ssl columns to proper one. Link to comment Share on other sites More sharing options...
websitenewbie Posted October 24, 2017 Author Share Posted October 24, 2017 I think there must be another issue. I have double checked the values in the database for both the ps_shop_url and the domain_ssl columns and they both have dev.domain.com. I have also checked the .htaccess file and there is only one please i can see the url reference towards the top of the document which I have already changed to dev.domain.com. However, when I enter dev.domain.com into the address bar it is still redirecting to www.domain.com Link to comment Share on other sites More sharing options...
websitenewbie Posted October 24, 2017 Author Share Posted October 24, 2017 I have updated the domain urls in the configuration table of prestahop 1.7.1, is there another table I need to update? Maybe I am updating the wrong table? Link to comment Share on other sites More sharing options...
websitenewbie Posted October 24, 2017 Author Share Posted October 24, 2017 If anyone has any other ideas I'd really appreciate the support. I have tried the comments above but I seem to be getting the same issue. When I do a redirect check at http://www.redirect-checker.org/index.php I am getting a 301? What else can I check? Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 24, 2017 Share Posted October 24, 2017 (edited) Did You test it in incognito mode of Your browser as I mentioned before? Paste here content of Your htaccess file from main folder. Edited October 24, 2017 by hakeryk2 (see edit history) Link to comment Share on other sites More sharing options...
websitenewbie Posted October 25, 2017 Author Share Posted October 25, 2017 Yes I tried that and still the same. I also did a hard refresh and cleared all the browser data and still the same. Here is the .htaccess file # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums <IfModule mod_rewrite.c> <IfModule mod_env.c> SetEnv HTTP_MOD_REWRITE On </IfModule> RewriteEngine on #Domain: dev.domain.com RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api$ api/ [L] RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # Images RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L] RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L] RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L] RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L] RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L] # AlphaImageLoader for IE and fancybox RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L] # Dispatcher RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L] </IfModule> AddType application/vnd.ms-fontobject .eot AddType font/ttf .ttf AddType font/otf .otf AddType application/font-woff .woff AddType application/font-woff2 .woff2 <IfModule mod_headers.c> <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> </IfModule> <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType text/css "access plus 1 week" ExpiresByType text/javascript "access plus 1 week" ExpiresByType application/javascript "access plus 1 week" ExpiresByType application/x-javascript "access plus 1 week" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" ExpiresByType image/vnd.microsoft.icon "access plus 1 year" ExpiresByType application/font-woff "access plus 1 year" ExpiresByType application/font-woff2 "access plus 1 year" ExpiresByType application/x-font-woff "access plus 1 year" ExpiresByType application/vnd.ms-fontobject "access plus 1 year" ExpiresByType font/opentype "access plus 1 year" ExpiresByType font/ttf "access plus 1 year" ExpiresByType font/otf "access plus 1 year" ExpiresByType application/x-font-ttf "access plus 1 year" ExpiresByType application/x-font-otf "access plus 1 year" </IfModule> <IfModule mod_headers.c> Header unset Etag </IfModule> FileETag none <IfModule mod_deflate.c> <IfModule mod_filter.c> AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype image/svg+xml </IfModule> </IfModule> #If rewrite mod isn't enabled ErrorDocument 404 /index.php?controller=404 # ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 25, 2017 Share Posted October 25, 2017 Try change in htaccess to:#Domain: dev.domain.comRewriteRule . - [E=REWRITEBASE:/dev/] Check again in incognito, if it will works, then go to back office and go to Preferences -> Seo and url and hit save whatever You want. Link to comment Share on other sites More sharing options...
websitenewbie Posted October 25, 2017 Author Share Posted October 25, 2017 Just tried that and it still redirects to www.domain.com Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 25, 2017 Share Posted October 25, 2017 Have You tried to go dev.domain.com/youradminfolder ? Is it working? Or could You send me on private message URL to your dev site and adminurl without credentials (password and login)? Link to comment Share on other sites More sharing options...
websitenewbie Posted October 25, 2017 Author Share Posted October 25, 2017 I have just messaged you. It redirects for both the BO url and the FO. It's driving me crazy now, been on this for 2 days and can't seem to find the issue. Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 25, 2017 Share Posted October 25, 2017 (edited) So let's sumarize all of the information: In ps_shop_url table in domain you have: dev.domain.com, in domain_ssl you have dev.domain.com, in physical_uri you have /dev/ In ps_configuration table in value PS_SHOP_DOMAIN you have value dev.domain.com, in PS_SHOP_DOMAIN_SLL you have dev.domain.com in htaccess You have#Domain: dev.domain.comRewriteRule . - [E=REWRITEBASE:/dev/] And it is not working? Edited October 25, 2017 by hakeryk2 (see edit history) Link to comment Share on other sites More sharing options...
websitenewbie Posted October 25, 2017 Author Share Posted October 25, 2017 I dont have a ps_shop_url table, I haven't had that in any of the prestashop 1.7 versions? i have however updated the ps_configuration table Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 25, 2017 Share Posted October 25, 2017 (edited) Yes, You have this table but have you tried to go to SECOND page of result in phpMyAdmin tables list? Or try in SQL SELECT * FROM `ps_shop_url` Edited October 25, 2017 by hakeryk2 (see edit history) Link to comment Share on other sites More sharing options...
websitenewbie Posted October 25, 2017 Author Share Posted October 25, 2017 OMG I feel so stupid. I didn't realise there was a second page. Okay so I have just updated the shop_url table but now its re-directing to https and not http 1 Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 25, 2017 Share Posted October 25, 2017 That is why probably Your main site is using SSL so You have to ps_configuration and change: PS_SSL_ENABLED value to 0 PS_SSL_ENABLED_EVERYWHERE value to 0 Link to comment Share on other sites More sharing options...
websitenewbie Posted October 25, 2017 Author Share Posted October 25, 2017 Is there a way around this as the main site www.domain.com needs to run ssl everywhere and the dev.domain.com doesn't. Also, I cant find the ssl column in the configuration table? Link to comment Share on other sites More sharing options...
websitenewbie Posted October 25, 2017 Author Share Posted October 25, 2017 No worries just done it now. Thank you so much for your help, I really appreciate it. You're a legend 1 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