Force HTTPS using a redirect

If you have setup an SSL certificate and you want all incoming HTTP requests to use the SSL you need to force the browser to use HTTPS requests. To do this you need to create a .htaccess file and place this in the root of your web folder (HTTPDOCS)
If you already have a .htacess file you can just edit it with a text editor (we use notepad++) and enter the following code at the top. (The dot before htaccess is required in the name)

Make sure you enter the code cleanly with no additional carachters or spaces as this can break the functionality of the .htacess. Save the file , upload it to your web folder and then test your site again to see if its loading under HTTPS

####### Redirect to https ##################################
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
######################################################

Remember to change yourdomain.com to the domain name of your website.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How Do I Upload Files Via FTP

First you need to get an FTP client. There are lots of free clients on the web. Once you've...

I have a website, where/how do I upload my website files?

If you have created a website and wish to upload it to your webspace, you must upload it into...

How to redirect your site using htaccess

It is sometimes necessary to redirect an entire domain to another destination domain . This can...

Installing Wordpress or an application from the Application Vault returns an error.

You might find when installing an application from the Application Vault for example Wordpress,...

Migrate Wordpress to a new domain name

Changing Your WordPress Domain Name While Moving Your Site to a New Location There are different...