Our Leadership team is attending CloudFest 2026, from Mar 22 - April 8. Schedule a Connect

Our Leadership team is attending CloudFest 2026, from Mar 22 - April 8.

Discuss MSP growth, DevOps excellence, and Cloud Transformation. Available for 1:1 meetings, Schedule a Connect

  • DevOps
    Case Study

    How we helped a development company rebuild DevOps for efficiency and scale.

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How a US hosting leader scaled with us!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    Enabling financial grade platforms through strategic cloud modernisation.

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Managed Services Overview
  • Kubernetes Consulting
  • DevOps as a Service
  • Infrastructure Monitoring
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Services
  • Managed Services

aws partneraws advanced partner
LinkedInFacebookXInstagramYouTube
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy

How to redirect http based site to https?

Author Profile
Anitta Jose
  • 3 min read
How to redirect http based site to https?

Generating audio, please wait...

SSL certificates are used to secure our websites. Once we install SSL on our website, we should redirect all our website URL’s to its HTTPS version. There are many ways to redirect http to https.

Redirect HTTP to HTTPS with Apache

If we are having a user level access in an Apache server, .htaccess file is the better way. Same would work for OpenLiteSpeed also. Have you heard of .htaccess files? A .htaccess file also called Hypertext file, helps us to configure our website without editing server wide configuration. It controls the directory and its sub-directories in which it is placed. Add the following lines in .htaccess file:

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Sometimes, if we are behind a load balancer, like AWS ELB, we may need to have an entry like this in .htaccess file:
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]

RewriteCond %{HTTPS} off

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
 If we have access to the Apache main server wide configuration file, edit the virtual host configuration to say below:
<VirtualHost *:80>ServerName www.domain.com

Redirect / https://www.domain.com/

</VirtualHost>

<VirtualHost *:443>

ServerName www.domain.com

# ... SSL configuration goes here

</VirtualHost>

 Redirect HTTP to HTTPS with Nginx

If the server is having Nginx as its webserver, then edit its configuration file and add the following lines:

server {

listen 80;

server_name www.domain.com;

return

301 https://$server_name$request_uri;

}

server {

listen 443 ssl;

server_name www.domain.com;

# Add Strict-Transport-Security to prevent Man in the Middle Attacks (HSTS Policy)

add_header Strict-Transport-Security "max-age=31536000" always;

[.…]

}

Man in the Middle Attack is an attack where an attacker secretly interferes the communication between two parties who believe they are communicating with each other. HSTS helps to prevent this attack. Actually HSTS is a web security policy by which the website inform the browsers that it should never load the site using HTTP but only using HTTPS protocol.

While using the above codes, don’t forget to replace “domain.com” with the actual domain name.

The SSL certificate installation is now completed, and our website is configured to accept secure connections.

Get 24/7 expert server management

  • General
  • Howtos
How to redirect http based site to https?

“SED” Options and its usage

“SED”  Options and its usage
  • Howtos
  • Linux
logo

An Introduction to AWK

An Introduction to AWK
  • Linux
  • Training
logo

Configure Disk Quota on Ubuntu Server

Configure Disk Quota on Ubuntu Server
  • Linux
logo

How to check whether UDP connection is open or not?

How to check whether UDP connection is open or not?
  • Linux
logo

Posts by Anitta Jose

Anitta is systems engineer since 2015 and holds broad experience in Linux, WordPress, and cPanel systems administration. Her interest lies more in Cloud technologies (AWS). From 2016, she writes blogs to share her experiences with wider audience.