Jump to content

Where to put htaccess file [Solved]


Recommended Posts

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 by mehmetsen80 (see edit history)
Link to comment
Share on other sites

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 by Whispar1 (see edit history)
Link to comment
Share on other sites

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

×
×
  • Create New...