Categories
Servers Useful

HTTP headers used by Cloudflare when operating as a Reverse Proxy

CF-IPCountry – This header contains the country code of the home visitor, it is a two-character value that will contain the country code, if the country is unknown, it will be “XX” True-Client-IP – Provides the IP address of the client (visitor) for each request to the source, CloudFlare adds the True-Client-IP header. Cloudflare always […]

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’])) { […]

Categories
Servers Useful

How to use Cloudflare CF-IPCountry Hader in .htaccess !

The CF-IPCountry header is specific only to those who use Cloudflare in “Proxied” mode, so if you do not use Cloudflare, then this article is not useful! 1). How to block traffic from specific countries using CloudFlare If for any reason you want to block visitors from any country, the solution is extremely simple and […]

Categories
Linux Useful

Convert Subtitles SRT from ISO-8859-16 to UTF-8 – iconv – Linux

On the current personal NAS server, which is more like a Media Server for a Home Theater, I installed Jellyfin instead of more “popular” but not one of the most suitable for Home Media Center, such as Open Media Vault, or Amahi. The current configuration replaced an older server for which I used OMV (Open Media […]

Categories
Linux Useful

How to Remove Files Recursively using Wildcard? – Linux Command Line

A short time ago I had to delete a lot of files created by a script, which I didn’t need anymore, but those files were scattered all over the disk, in many folders and subfolders. After scouring the whole internet, reading all sorts of scripts and commands, I finally found a close solution, which I […]