Radek100 Posted January 4, 2013 Share Posted January 4, 2013 (edited) Hi, (for better understand go to post #8) I don't know how to get www infront to domain name. I would like to have www.domain.com, instead of this I have domain.com. Do anybody know why? When I set in database to PS_SHOP_URL www.domain.com and in PS_CONFIGURATION same www.domain.com I will get error 404 page is not available. It works only if both PS_ are filled with domain.com Thank you Edited January 5, 2013 by Radek100 (see edit history) Link to comment Share on other sites More sharing options...
Site Posted January 4, 2013 Share Posted January 4, 2013 Which version of Prestashop are you using? Link to comment Share on other sites More sharing options...
Radek100 Posted January 4, 2013 Author Share Posted January 4, 2013 I am using 1.5.3.1. version Link to comment Share on other sites More sharing options...
Site Posted January 4, 2013 Share Posted January 4, 2013 My shop urls in the database are set not to have www. infront Im using SEO friendly urls which adds the www. back Could we have the link to your website? Link to comment Share on other sites More sharing options...
Radek100 Posted January 4, 2013 Author Share Posted January 4, 2013 (edited) On 1/4/2013 at 11:17 PM, Site said: My shop urls in the database are set not to have www. infront Im using SEO friendly urls which adds the www. back Could we have the link to your website? sent to pm I use SEO friendly too, but no www. added. But I think that it is caused with htaccess. Maybe... Edited January 4, 2013 by Radek100 (see edit history) Link to comment Share on other sites More sharing options...
Site Posted January 5, 2013 Share Posted January 5, 2013 Have you tried turning SEO friendly urls off an saving, recompile smarty, then add SEO friendly URLS again Link to comment Share on other sites More sharing options...
parsifal Posted January 5, 2013 Share Posted January 5, 2013 Hello. In order to have the www prefix working correctly for your website, you should also edit the DNS records of your domain name and add a proper CNAME record which should point to the "naked" domain. Don't forget that the www prefix is not a special case but it is handled like any other possible subdomain you could have under your domain (for example vps2.yourdomain.com is not inherently different from www.yourdomain.com or www2.yourdomain.com). You may also have to make some adjustments in your web server's configuration. For example, if your website host uses the Apache web server, you may need to edit the Virtual Hosts configuration to accomplish special handling and/or redirection. You could, for instance, have Apache automatically rewrite all requests for the naked domain to ones including the www prefix. So, a visitor that enters http://yourdomain.com in his web browser would automatically land on http://www/yourdomain.com. Similar functionality can be achieved with other web servers also, e.g. nginx, lighttpd etc. Link to comment Share on other sites More sharing options...
Radek100 Posted January 5, 2013 Author Share Posted January 5, 2013 (edited) I really need help, don't know what is better. Now all my old site is loaded to search engines, like google etc. with www. - all links include this - which work with old prestashop 1.4.x Now I upgrade to prestashop 1.5.3.1. and all my site work only without www so all links looks like http://domainname.com/.... So if I go to my website through search engine all loaded pages to google show 404 page not found in my shop. solution which works me is to add this code into htaccess: RewriteCond %{HTTP_HOST} ^www.domain.com RewriteRule (.*) http://domain.com/$1 [R=301,QSA,L] but I this is not solution for redirect link www.domain.com/en/index which I have loaded in one most used searcher I don't know if is better to redirect all pages to http://domain.com.... or solve this problem to add www infront of domain name Please help, it's really urgent Is possible to add or change htaccess to redirect http://www.domain.com/en/index to http://domain.com/en/ Edited January 5, 2013 by Radek100 (see edit history) Link to comment Share on other sites More sharing options...
MEG Venture Posted January 5, 2013 Share Posted January 5, 2013 Have you checked the domain settings from the Cpanel of your host provider? Link to comment Share on other sites More sharing options...
Radek100 Posted January 5, 2013 Author Share Posted January 5, 2013 no, but I think that problem with www caused prestashop, because old version works, so something must be with 1.5.3.1 :-( on host provider I have changed nothing. Only upgrade prestashop Link to comment Share on other sites More sharing options...
MEG Venture Posted January 5, 2013 Share Posted January 5, 2013 Did you try to remove the additional lines from .htaccess, then set SEO&URL settings with www infront and then regenerate the .htaccess file? Again, I would check the cpanel settings for the domain anyway. Link to comment Share on other sites More sharing options...
Radek100 Posted January 5, 2013 Author Share Posted January 5, 2013 (edited) On 1/5/2013 at 3:19 PM, MEG Venture said: Did you try to remove the additional lines from .htaccess, then set SEO&URL settings with www infront and then regenerate the .htaccess file? Again, I would check the cpanel settings for the domain anyway. Oh man, I removed those lines and add www into SEO&URL and it is working now. I read somewhere that in into database I should put domain.com without www. so I wrote only domain.com to PS_SHOP_URL Thank you so much, you saved my life :-), (it was strange to me because I got some error on home page of BO, because I was logged in domain.com/admin and it is necessary to log out and log in to www.domain.com/admin then error doesn't appear I need only last think: redirect old www.domain.com/en/index (it is loaded to one search engine and show 404) to www.domain.com/en/ or www.domain.com/en/index.php (I think it is same result) It will be this? # URL rewriting rules RewriteRule ^index /cs/index.php [R=301,NC] or like this? # URL rewriting rules RewriteRule ^index$ /cs/index.php [R=301,NC] Tried both, no one works me :-( Edited January 5, 2013 by Radek100 (see edit history) Link to comment Share on other sites More sharing options...
MEG Venture Posted January 5, 2013 Share Posted January 5, 2013 I am glad you solved the issue. However, I don't suggest to modify the .htaccess file. Instead, you can use Google Webmaster Tools and update/remove the wrong listed link. Regards. Link to comment Share on other sites More sharing options...
Radek100 Posted January 5, 2013 Author Share Posted January 5, 2013 I know, I have already contact them, but I am looking for temporary solution. Some way how to temporary redirect that /en/index to /en/index.php or /en/ Link to comment Share on other sites More sharing options...
MEG Venture Posted January 5, 2013 Share Posted January 5, 2013 Please try this: //301 Redirect Old File Redirect 301 http://www.domain.com/en/index http://www.domain.com/en/index.php Link to comment Share on other sites More sharing options...
Radek100 Posted January 5, 2013 Author Share Posted January 5, 2013 (edited) On 1/5/2013 at 3:53 PM, MEG Venture said: Please try this: //301 Redirect Old File Redirect 301 http://www.domain.com/en/index http://www.domain.com/en/index.php When I add this code my site stop working no one page. I will get error 500. I tried # URL rewriting rules RewriteRule www.domain.com/en/index www.domain.com/en/index.php [R=301,NC] no effect :-( should't be it this way? instead of // this# #301 Redirect Old File Redirect 301 http://www.domain.com/en/index http://www.domain.com/en/index.php Edited January 5, 2013 by Radek100 (see edit history) Link to comment Share on other sites More sharing options...
MEG Venture Posted January 5, 2013 Share Posted January 5, 2013 What about this? //Redirect Old File Redirect http://www.domain.com/en/index http://www.domain.com/en/index.php Link to comment Share on other sites More sharing options...
Radek100 Posted January 5, 2013 Author Share Posted January 5, 2013 no effect, I removed // and put instead of this # no error 500 but also no redirect :-(, if this won´t be a home page I save my time and let it be, but the home page is most searched and used :-( Link to comment Share on other sites More sharing options...
MEG Venture Posted January 5, 2013 Share Posted January 5, 2013 What is the link of the 404 error page? Maybe you can redirect 404 page to the homepage using this: Redirect http://www.domain.com/404.php http://www.domain.com Link to comment Share on other sites More sharing options...
Radek100 Posted January 5, 2013 Author Share Posted January 5, 2013 (edited) I got it!!! YES # Redirect Redirect 301 /en/index http://www.domain.com/en/index.php Oh I'm so glad. There should't be domain name in first code, don´t know why, but it works, that's important. But thank you so much, I owe you a hour of your life :-). Thank you for your time! I appreciate it. Edited January 5, 2013 by Radek100 (see edit history) Link to comment Share on other sites More sharing options...
MEG Venture Posted January 5, 2013 Share Posted January 5, 2013 No problem... Take care! 1 Link to comment Share on other sites More sharing options...
Site Posted January 5, 2013 Share Posted January 5, 2013 Glad to see you have found a fix 1 Link to comment Share on other sites More sharing options...
syahrulbrandson Posted January 12, 2013 Share Posted January 12, 2013 On 1/5/2013 at 3:37 PM, Radek100 said: Oh man, I removed those lines and add www into SEO&URL and it is working now. I read somewhere that in into database I should put domain.com without www. so I wrote only domain.com to PS_SHOP_URL Thank you so much, you saved my life :-), (it was strange to me because I got some error on home page of BO, because I was logged in domain.com/admin and it is necessary to log out and log in to www.domain.com/admin then error doesn't appear I need only last think: redirect old www.domain.com/en/index (it is loaded to one search engine and show 404) to www.domain.com/en/ or www.domain.com/en/index.php (I think it is same result) It will be this? # URL rewriting rules RewriteRule ^index /cs/index.php [R=301,NC] or like this? # URL rewriting rules RewriteRule ^index$ /cs/index.php [R=301,NC] Tried both, no one works me :-( where is the additional line .htaccess should be removed? please show me, i have same problem Link to comment Share on other sites More sharing options...
Recommended Posts