• Companion Auto Update
  • Companion Sitemap Generator
  • Companion Revision Manager
  • Companion Portfolio

Papin Schipper (CodeerMeneer)

Coffee addict & WordPress developer

  • Hello
  • Plugins
  • Blog
  • Documentation
  • Contact me
  • Menu

How to force WordPress to use SSL

  1. 1 Home
  2. 2 Blog
  3. 3 How to force WordPress to use SSL
Keyboard Papin Schipper

Force WordPress to use SSL: When youre using SSL on your WordPress-powered website youll know that simply changing your websites url in the setting isnt enought, it will redirect the homepage to your HTTPS version, but when a user goes to example.com/blog it wont redirect to HTTPS, this can cause trouble with including stylesheets etc. Now, you can use a plugin to fix this but if youre like me and dont want to use plugin unless absolutely necessary you can do this yourself.

Without a plugin

.htaccess

Simply add the following code to your .htaccess file will make it work.

# BEGIN WordPress
 RewriteEngine On
 RewriteCond %{HTTPS} !=on
 RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
 RewriteRule ^index.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 # END WordPress

Javascript

Or you can add the following piece of Javascript to your site.

<script>
if (document.location.protocol != "https:") {
document.location = document.URL.replace(/^http:/i, "https:");
}
</script>

With a plugin

Ofcourse you can also use a plugin to do this for you, I myself use Really Simple SSL and would highly recommend it.

Tags: #WordPress
Papin Schipper 17 May 2016

Continue reading

How To Create Custom Post Meta Boxes In WordPress

SEO: WordPress Update Services

WordPress Update Services (Good for SEO) Why user the WordPress Update Services? When youre writing a blog-post you want it to be found in searchengines right? There is one simple way to make this go a little  bit better. You can alert certain website-trackers by adding them to the list of WordPress Update Services. Add […]

Papin Schipper 17 May 2016

Companion WordPress Plugins

Helping you get the most out of your WordPress website, that’s what the Companion Plugins for WordPress are all about.

Check out my portfolio for all the plugins.

I’m always looking for new ideas as to what I can create next, or what can be improved to one of my existing plugins so don’t hesitate to contact me about any idea!

Recent posts

  • WordPress 5.5 versus Companion Auto Update
  • Companion Auto Updates’ most requested feature is here (sort of)
  • Add more intervals to the options in Companion Auto Update
  • How to use the shortcode in Companion Portfolio
  • Companion Sitemap Generator <3 Gutenberg

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Papin Schipper (CodeerMeneer)Coffee addict & WordPress developer
  • HTML Sitemap
  • Curriculum Vitae
  • Plugins for WordPress
  • Hire me?