Blog
# Apache Rewrite Rules <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTPS} !=off RewriteRule ^/?(checkout|account|admin) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^test_website\.com [NC] RewriteRule ^(.*)$ https://www.test_website.com/$1 [R,L] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # End of Apache Rewrite Rules </IfModule>Copy this code in config.php file in website folder.
config.php // HTTP define('HTTP_SERVER', 'https://www.test_website.com/'); // HTTPS define('HTTPS_SERVER', 'https://www.test_website.com/'); define('HTTPS_IMAGE', 'https://www.test_website.com/image/');This changes will improve your website with HTTPS protocol.
<Files ~ "\.js$"> order allow,deny deny from all </Files>We can also add .htaccess file CSS files folder to protect CSS files from direct access.
<Files ~ "\.css$"> order allow,deny deny from all </Files>Add one more Files block if css or javascript file contains multiple dots(.) like style.min.css
<Files ~ "\min.css$"> order allow,deny deny from all </Files>« Previous Next »
Blog
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page