Post by HSLGuy » Sun Apr 29, 2018 11:05 pm

Newbie here setting up first Opencart store...

I was about to remove the .txt from the .htaccess.txt file to enable SEO URLs. However there is already a .htaccess file right there with the .htaccess.txt file. I see that it does not not come included with Opencart so I'm guessing that maybe one of the few extensions I installed may have created it??

I'm not sure if the code in there is important, so I'm wondering if anyone knows how I should continue. Should I try to combine the code of the two?

Here's the content of the existing .htaccess file:

Code: Select all

<ifModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/pdf "access plus 1 week"
ExpiresByType text/x-javascript "access plus 1 week"
ExpiresByType application/x-shockwave-flash "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresDefault "access plus 1 week"
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

RewriteEngine on
Thanks for any insight.



Thu Apr 19, 2018 3:19 am

Post by uksitebuilder » Mon Apr 30, 2018 3:27 pm

Safe to merge that with the opencart .htaccess.txt file and remove the .txt extension.

Copy the code you have put (apart from the last line) and paste in to the bottom of the opencart htaccess


For Friendly Professional Support - Click Here

User avatar
Guru Member


Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by HSLGuy » Mon Apr 30, 2018 9:27 pm

Great I copied everything except the "RewriteEngine on" over and it seems to be working great. That makes sense since I see there is already a RewriteEngine on statement in the default .htaccess

Thanks for your help!



Thu Apr 19, 2018 3:19 am
Who is online

Users browsing this forum: No registered users and 26 guests