.htaccess Tricks

Restrict Direct Access To Files

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^https://(www\.)?mywebsite\.com/ [NC]
RewriteCond %{REQUEST_URI} !hotlink\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov) [NC]
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
RewriteRule .*\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov)$ https://mywebsite.com/ [NC]

Force SSL

RewriteCond %{HTTP_HOST} mywebsite\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://mywebsite.com/$1 [R,L]

Redirect One page to another page

Redirect /membership-options/ https://mywebsite.com/membership-login

…More To Come.