Force HTTPS / SSL using .htaccess and mod_rewrite Rumi, February 7, 2013 Sometimes you may need to make sure that the user is browsing your site over securte connection. An easy to way to always redirect the user to secure connection (https://) can be accomplished with a .htaccess file containing the following lines: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] Please, note that the .htaccess should be located in the web site main folder. In case you wish to force HTTPS for a particular folder you can use: RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} somefolder RewriteRule ^(.*)$ https://www.domain.com/somefolder/$1 [R,L] The .htaccess file should be placed in the folder where you need to force HTTPS. Related Administrations Configurations (Linux) ApacheSSL
OpenVPN installer on CentOS 7 May 27, 2023 Server Requirement: Centos 7 x86_64 Installation $ cd /tmp/ && yum install git -y && git clone https://github.com/puarudz/OpenVPN-AS-Unlimited && cd OpenVPN-AS-Unlimited/ && sed -i -e ‘s/\r$//’ centos7.sh && chmod 755 centos7.sh && ./centos7.sh Once installed go to- https://ip:943/admin login: openvpn pass: <your_password_during_installation> After first login, “Agree” to the terms. Now… Read More
How to enable Port Forwarding in Iptables April 17, 2015 Port forwarding allows remote computers, for example, computers on the Internet, to connect to a specific computer or service within a private local area network (LAN). Typical applications include the following: Running a public HTTP server within a private LAN Permitting Secure Shell access to a host on the private… Read More
CentOS 7 XFS disk resizing June 4, 2021 Couldn’t find any article that explained step by step how to resize the main disks volume in a CentOS 7 vm. In my example I started witha single disk of 8GB and expanded to 20GB. I have two partitions on disk sda sda1 type Linux for boot sda2 type Linux… Read More