How to force redirect http to https using .htaccess

If you have an SSL certificate installed and would like to force your website to load with https URL - you may add the following code in the .htaccess file (Linux based hosting): RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] You need to place the .htaccess file in the home directory of your website.  

Continue reading

Whitelist IP or IP range in/out using iptables

#Flush existing rules iptables -F # Set up default DROP rule for eth0 (Assuming eth0 is the Ethernet Port) iptables -P INPUT DROP # Allow existing connections to continue iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT # Accept everything from the 192.168.0.x network iptables -A INPUT -i eth0 -s 192.168.0.0/24 -j…

Continue reading