mehmetsen80 Posted March 27, 2013 Share Posted March 27, 2013 (edited) I have an .htaccess file with the following content: RewriteEngine on Options +FollowSymlinks RewriteCond %{HTTP_HOST} ^www.([^\.]+\.[^\.]+)$ RewriteRule ^(.*)$ http://%1/$1 [R=301,L] I am redirecting the http://www.domain.com to http://domain.com I put the htaccess file under the root of apache where prestashop resides /var/www/html/ I see that htaccess is ignored and never takes affect Is that because of prestashop? Should I put the htacss file somewhere else? Edited March 27, 2013 by mehmetsen80 (see edit history) Link to comment Share on other sites More sharing options...
Whispar1 Posted March 27, 2013 Share Posted March 27, 2013 (edited) Prestashop automatically generates its own .htaccess file and should be in the root directory as you stated. # ~~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 In 1.5.3.1, Enabling friendly urls should regenerate it. Then add code if needed outside the comment lines to keep it from being overwritten when Prestashop regenerates the htaccess. Edited March 27, 2013 by Whispar1 (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted March 27, 2013 Share Posted March 27, 2013 it may be that your custom .htaccess directive is not working. try this instead: #Force non-www: RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301] Link to comment Share on other sites More sharing options...
mehmetsen80 Posted March 27, 2013 Author Share Posted March 27, 2013 Prestashop automatically generates its own .htaccess file and should be in the root directory as you stated. Unfortunately, there was no .htaccess file in the root directory, I had create by myself. I am using presta 1.4 version, could it be because of that? What is the way to regenerate the htaccess in 1.4 version? @elpatron I tried the RewriteEngine code in 2 different domains and I am sure it works, I guess it is because of root folder path? Link to comment Share on other sites More sharing options...
mehmetsen80 Posted March 27, 2013 Author Share Posted March 27, 2013 Ok, I found it, there was nothing wrong other than in my httpd.conf settings I changed AllowOverride None to AllowOvveride All I hope this will not effect other settings 1 Link to comment Share on other sites More sharing options...
Bruna BSPCU Posted March 27, 2013 Share Posted March 27, 2013 Please edit this title topic with [solved], thanks! Link to comment Share on other sites More sharing options...
mehmetsen80 Posted March 27, 2013 Author Share Posted March 27, 2013 @Bruna can't find the Edit button for Title? Link to comment Share on other sites More sharing options...
Whispar1 Posted March 27, 2013 Share Posted March 27, 2013 (edited) Click edit on your original post and use full editor and you should see the title there Edited March 27, 2013 by Whispar1 (see edit history) 1 Link to comment Share on other sites More sharing options...
Bruna BSPCU Posted March 28, 2013 Share Posted March 28, 2013 Found it? Ok then....thanks! Link to comment Share on other sites More sharing options...
Recommended Posts