Menu Close

How to redirect Http to Https Using .htaccess file

we can redirect the non SSL query to your website to SSL port by using .htaccess file.This will help you to access the websites from a secured port(443 of apache) of we server.

in your .htaccess file, you can add following code:


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

It will direct the Normal website URL to its SSL website URL.

How to redirect Http to Https in cpanel

In your Cpanel, go to domain and then redirect link:

Click Redirects link, and then you will go to following page:

 

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

See also  How to Implement a Caching Scheme with htaccess file
  • You must be logged in to reply to this topic.