Force redirect your website to HTTPS using .htaccess

There are many ways to redirect your website from HTTP to HTTPS, but I found this as the easiest and best way to do this.

Login to cpanel and edit the file .htaccess

Add the following code

RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

You site now will be automatically redirected to Https.

94 thoughts on “Force redirect your website to HTTPS using .htaccess”

  1. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is
    added I get three emails with the same comment. Is there any way you can remove people from
    that service? Thanks!

    Here is my site 먹튀검증

  2. Hey! I realize this is somewhat off-topic however I needed to ask.

    Does operating a well-established blog such as yours require a
    massive amount work? I’m completely new to operating a blog but I do write in my journal
    daily. I’d like to start a blog so I will be able to share my experience and thoughts online.
    Please let me know if you have any kind of suggestions or tips for brand new aspiring blog owners.
    Thankyou!

    My homepage … fx마진거래

  3. I do not know whether it’s just me or if perhaps everybody else
    experiencing problems with your blog. It appears as though some of the text on your content
    are running off the screen. Can somebody else please provide feedback and let me know if this is happening to them as well?
    This might be a issue with my web browser because I’ve had this happen before.

    Many thanks

    Here is my page … 토토뮤지엄

  4. With havin so much written content do you ever run into any issues of plagorism or copyright infringement?
    My site has a lot of unique content I’ve either written myself or outsourced
    but it looks like a lot of it is popping it up all over the web without my permission. Do you
    know any solutions to help protect against content from being
    ripped off? I’d really appreciate it.

    Feel free to surf to my website – 비트코인마진거래

  5. You are so cool! I do not suppose I’ve truly read anything like that before.

    So nice to find another person with some genuine thoughts on this subject.
    Really.. many thanks for starting this up. This web site is something that’s needed on the internet,
    someone with some originality!

    Feel free to surf to my blog :: 온라인홀덤

Leave a Comment

Your email address will not be published. Required fields are marked *

Tweet
Share
Share
Pin