JezK
Edit File: htaccess.txt
# Compress file response package <IfModule mod_filter.c> AddOutputFilterByType DEFLATE "application/atom+xml" \ "application/javascript" \ "application/json" \ "application/ld+json" \ "application/manifest+json" \ "application/rdf+xml" \ "application/rss+xml" \ "application/schema+json" \ "application/vnd.geo+json" \ "application/vnd.ms-fontobject" \ "application/x-font-ttf" \ "application/x-javascript" \ "application/x-web-app-manifest+json" \ "application/xhtml+xml" \ "application/xml" \ "font/eot" \ "font/opentype" \ "image/bmp" \ "image/svg+xml" \ "image/vnd.microsoft.icon" \ "image/x-icon" \ "text/cache-manifest" \ "text/css" \ "text/html" \ "text/javascript" \ "text/plain" \ "text/vcard" \ "text/vnd.rim.location.xloc" \ "text/vtt" \ "text/x-component" \ "text/x-cross-domain-policy" \ "text/xml" </IfModule> # Leverage browser caching # Caching image and css file # Can turn off in chrome for development, # 1 - inspect element # 2 - click to network tab # 3 - check disable cache # Utilize Maximum Caching #<FilesMatch ".(jpg|jpeg|png|gif|swf|css|js|svg|ttf|ttc|otf|eot|woff2|woff)$"> # Header set Cache-Control "max-age=2592000, public" #</FilesMatch> # 1.To use URL Alias you need to be running apache with mod_rewrite enabled. # 2. In your opencart directory rename htaccess.txt to .htaccess. # For any support issues please visit: https://www.opencart.com Options +FollowSymlinks # Prevent Directoy listing Options -Indexes # Prevent Direct Access to files <FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))"> Require all denied ## For apache 2.2 and older, replace "Require all denied" with these two lines : # Order deny,allow # Deny from all </FilesMatch> # SEO URL Settings RewriteEngine On # Error handling ErrorDocument 400 /error ErrorDocument 401 /error ErrorDocument 402 /error ErrorDocument 403 /error ErrorDocument 404 /error RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L] RewriteRule ^product-sitemap.xml$ index.php?route=extension/feed/google_sitemap/product [L] RewriteRule ^category-sitemap.xml$ index.php?route=extension/feed/google_sitemap/category [L] RewriteRule ^information-sitemap.xml$ index.php?route=extension/feed/google_sitemap/information [L] RewriteRule ^blog-sitemap.xml$ index.php?route=extension/feed/google_sitemap/blog [L] RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L] RewriteRule ^system/download/(.*) index.php?route=error/not_found [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] ### Redirect RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # ---------------------------------------------------------------------- # Expires headers (for better cache control) # ---------------------------------------------------------------------- <IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 1 month" ExpiresByType text/cache-manifest "access plus 0 seconds" ExpiresByType text/html "access plus 0 seconds" ExpiresByType text/xml "access plus 0 seconds" ExpiresByType application/xml "access plus 0 seconds" ExpiresByType application/json "access plus 0 seconds" ExpiresByType application/rss+xml "access plus 1 hour" ExpiresByType application/atom+xml "access plus 1 hour" ExpiresByType image/x-icon "access plus 1 week" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType video/ogg "access plus 1 month" ExpiresByType audio/ogg "access plus 1 month" ExpiresByType video/mp4 "access plus 1 month" ExpiresByType video/webm "access plus 1 month" ExpiresByType text/x-component "access plus 1 month" ExpiresByType application/x-font-ttf "access plus 1 month" ExpiresByType font/opentype "access plus 1 month" ExpiresByType application/x-font-woff "access plus 1 month" ExpiresByType image/svg+xml "access plus 1 month" ExpiresByType application/vnd.ms-fontobject "access plus 1 month" ExpiresByType text/css "access plus 1 year" ExpiresByType application/javascript "access plus 1 year" </IfModule> <filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> Header set Cache-Control "max-age=84600, public" </filesMatch> RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] # php -- BEGIN cPanel-generated handler, do not edit # Set the “ea-php56” package as the default “PHP” programming language. <IfModule mime_module> AddHandler application/x-httpd-ea-php56 .php .php5 .phtml </IfModule> # php -- END cPanel-generated handler, do not edit # BEGIN cPanel-generated php ini directives, do not edit # Manual editing of this file may result in unexpected behavior. # To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor) # For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI) <IfModule php5_module> php_value default_charset "UTF-8" php_value memory_limit 512M php_value max_execution_time 36000 php_value upload_max_filesize 999M php_value mysql.connect_timeout 20 php_flag session.auto_start Off php_flag session.use_only_cookies On php_flag session.use_cookies On php_flag session.use_trans_sid Off php_value session.cookie_httponly "On;" php_value session.gc_maxlifetime 3600 php_flag short_open_tag On php_flag display_errors On php_value error_reporting E_ALL php_flag asp_tags Off php_value max_input_time 3000 php_value max_input_vars 7000 php_value post_max_size 256M php_value session.save_path "/var/cpanel/php/sessions/ea-php56" php_flag zlib.output_compression Off </IfModule> <IfModule lsapi_module> php_value default_charset "UTF-8" php_value memory_limit 512M php_value max_execution_time 36000 php_value upload_max_filesize 999M php_value mysql.connect_timeout 20 php_flag session.auto_start Off php_flag session.use_only_cookies On php_flag session.use_cookies On php_flag session.use_trans_sid Off php_value session.cookie_httponly "On;" php_value session.gc_maxlifetime 3600 php_flag short_open_tag On php_flag display_errors On php_value error_reporting E_ALL php_flag asp_tags Off php_value max_input_time 3000 php_value max_input_vars 7000 php_value post_max_size 256M php_value session.save_path "/var/cpanel/php/sessions/ea-php56" php_flag zlib.output_compression Off </IfModule> # END cPanel-generated php ini directives, do not edit