Generate Apache .htaccess rules to force HTTPS, set www or non-www, add a 301 redirect, block an IP address and enable GZIP compression.
This generator writes common Apache .htaccess rules from a few checkboxes and fields. You can force all traffic to HTTPS, redirect visitors to either the www or non-www version of your domain, add a permanent 301 redirect from an old path to a new one, block a single IP address, and enable GZIP compression for HTML, CSS, JavaScript, JSON and XML responses.
The file is rebuilt instantly as you change options, with a comment above each block explaining what it does. Copy the result into the .htaccess file at your site root. It is meant for Apache servers with the rewrite and deflate modules enabled; other web servers use different configuration formats.
Save them in a file named .htaccess in your website's root folder on an Apache server, or merge them into the one already there.
The form creates one redirect at a time. Generate a rule, copy it, then change the paths and copy the next line into the same file.