Force SSL on a WordPress

301 redirect
301 redirect

I’ve noticed that a .htaccess redirect works from the root folder down, but if you access the website from an old link you won’t be forced to HTTPS.

Updating the WP URL structure does not help

wordpress URL
WordPress URL

The Redirect

This will work to force the redirect:

If you are running WordPress in a sub folder, the following lines:

RewriteBase /blog/
RewriteRule . /blog/index.php [L]
Isaac Adams-Hands

Full Stack Developer, Digital Marketer, and InfoSec enthusiast. He received his Bachelor’s Degree from the University of Western Sydney and his Business Diploma from Georgian College before joining various marketing positions in search portals, e-commerce, higher education, and addiction recovery services.

Follow @ twitter

Related posts

How-to: Format a USB to FAT32 MBR

I was making a piratebox and the USB needed to be formatted in FAT32, MBR format. Apple’s disk utility wasn’t co-operating, so I moved over to Terminal. Terminal In Terminal, search for your USB using the command: Find your USB name and disk number, then enter the following command (be careful you don’t select the… Read More

Saving your Data

Spending some time at the cottage has led me to realize I can burn through 12GB of data really fast. Here are 6 ways to save data at the cottage, when traveling abroad, or on poor bandwidth connections: 1. Use Alternative Sources Ditch News & Magazine styled websites, alternatively, use Twitter to keep up-to-date 2…. Read More