Categories
PHP Useful

Get HTTP Status Code from Header – PHP

1. First of all we have to: deactivate the SSL verification because there are cases in which the site is redirected from a domain where the SSL has expired! limit the number of redirects, so as not to enter an endless loop initialize User-Agent with a real value , otherwise there is the possibility that […]

Categories
Security Useful

Secure Your Browser with Secure DNS – DNSSEC, TLS and Encrypted SNI

Well, this is new to many, and for most it is like an alien technology, but this is the future and it is absolutely necessary for the internet, oh, I could say urgently! So what do you need to do to get a better night’s sleep, knowing that your traffic is not “spied on” by […]

Categories
Servers Useful

Automatic HTTPS redirection for HTTP – htaccess,php,html or javascript

1). How to redirect HTTP to HTTPS from .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule> The above code redirects any subdomain not just the base domain. A 301 redirect is a permanent redirect that tell search engines that URL has moved permanently. 2). How to Redirect With PHP if (empty($_SERVER[‘HTTPS’])) { […]