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

Remove a repository in source list using terminal

List You can remove the repository from the sources list using terminal. Find First you need to find your lists: sudo ls /etc/apt/sources.list.d Command Look for your desire PPA here and then remove the PPA using the following command: sudo rm -i /etc/apt/sources.list.d/PPA_Name.list

Stopping Spam

I’ve noticed when you share your email address on classified advertising services like kijiji.ca or employment-related search engines like Indeed.com, spammers web scrap the boards and harvest your email address. This normally leads to countless unsolicited junk emails. Top level domains To combat this, I have monitored incoming email addresses, setting up email rules to filter… Read More