Skip to content

Instantly share code, notes, and snippets.

Working from home

MS Shohan msshohan

Working from home
View GitHub Profile
ShiponKarmakar / .htaccess
Last active Aug 6, 2020
Most Useful and Helpful .htaccess Code
View .htaccess
#stop directory browsing
Options All -Indexes
# SSL Https active Force non-www
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
You can’t perform that action at this time.