Implement HSTS using .htaccess

HTTP Strict Transport Security¬†(HSTS) is a web security policy that will force requests to be servers via secure connections HTTPS. Simple HTTP requests are not served. HSTS syntax is: Strict-Transport-Security: max-age=<expire-time> Strict-Transport-Security: max-age=<expire-time>; includeSubDomains Strict-Transport-Security: max-age=<expire-time>; preload max-ageThe time, in…

Continue Reading Implement HSTS using .htaccess

Redirect HTML extension to PHP

It's very easy to redirect requests to .html pages to .php pages. You will need to add some lines to the .htaccess file. If this file doesn't exist in your directory then you must create it. The two lines are:…

Continue Reading Redirect HTML extension to PHP

Block directory access with .htaccess rules

It's very simple to block access to a directory. We will use in this article some rules for the .htaccess file. Just add the following lines in your .htaccess file: RedirectMatch 403 ^/folder_name/?$ ErrorDocument 403 default The above lines will…

Continue Reading Block directory access with .htaccess rules