tanureja Posted June 23, 2016 Share Posted June 23, 2016 (edited) Hi, Tried to search the forum but can't find the same issue addressed. I always got redundant hostnames from google analytics to find out my custom rewrite engine below : == #Domain: sukucadangmotor.com RewriteCond %{HTTPS} off RewriteRule (.*) https://sukucadangmotor.com%{REQUEST_URI} [L,R=301,NC] RewriteCond %{HTTP_HOST} ^www.sukucadangmotor.com [NC] RewriteRule (.*) https://sukucadangmotor.com%{REQUEST_URI} [L,R=301,NC] == got changed to default prestashop rewrite engine setting : == #Domain: sukucadangmotor.com RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api$ api/ [L] == This caused redundant hostnames in google analytics. Really appreciate your help on how to make this setting permanent so I won't have the same problem everytime I clear cache or recreate friendly url. Thanks a lot. Edited June 23, 2016 by tanureja (see edit history) Link to comment Share on other sites More sharing options...
Rolige Posted June 23, 2016 Share Posted June 23, 2016 PrestaShop have 2 lines in the .htaccess file, inside these lines include their code, but you can write your own code outside of these lines and will remain even when the .htaccess is regenerated. # # You can write your custom code here # # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again # Here is writed the PrestaShop code # ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again # # Also here, you can write your custom code # Link to comment Share on other sites More sharing options...
tanureja Posted June 23, 2016 Author Share Posted June 23, 2016 COTOKO thanks for the reply. Yes I knew about that, but how to modify those part of htaccess regeneration area to custom area. Link to comment Share on other sites More sharing options...
Rolige Posted June 23, 2016 Share Posted June 23, 2016 You need add your changes in the file /classes/Tools.php In the method public static function generateHtaccess() { ... } My recommendation is that you create an override file. Link to comment Share on other sites More sharing options...
tanureja Posted June 24, 2016 Author Share Posted June 24, 2016 Thanks a lot COTOKO Link to comment Share on other sites More sharing options...
Rolige Posted June 25, 2016 Share Posted June 25, 2016 Thanks a lot COTOKO You're welcome 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