We use cookies to make Serpstat better. By clicking "Accept cookies", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. Learn more

Report a bug

How-to 4 min read

How to set redirect 301 from HTTP to HTTPS site version

In order to set redirect 301 from http to https, it is necessary to make modifications in the file .htaccess in the root folder of the site. This is done after installing the SSL certificate. Correctly set redirect enables the full indexing when relocating the site to the https version.

When is redirecting from http to https necessary?

It is the final step by transferring the site from http to https version. After the setting redirect 301 of all pages, installing SSL certificate is considered complete.

To improve indexing and prevent errors, it is recommended to check for having redirect on all pages. Two identical URL with http and https can be recognized as duplicates, and the weight will not be transferred. The page weight will decrease because of interlinking to https version. Ideally, all pages should forward a user from http to https automatically.

By interlinking in the text, the links also should forward to updated pages. None of the links can forward to the addresses with http version. To detect incorrectly set redirects and interlinking fragments, use Serpstat's audit or the same tools. This way, you can quickly and precisely define pages with an incorrectly set redirect.
HTTPS site audit in Serpstat

How to set correctly redirect 301 from http to https?

Let us suppose that you ordered an SSL certificate from your hosting provider, and it is automatically provided to your site. Before you start, ask for customer service, how is better to set redirect 301 from http to https for your specific case.

If you installed a safety certificate yourself, it is necessary to add the command in the file .htaccess. It is located in the root folder of the site, which you can reach through the file manager or hosting management system.

The file location in the Plesk panel looks in the following way:
htaccess file in the root folder of a site
By opening it in any text editor, add one of the commands in the next line after Rewrite Engine On directive:
Setting up redirects on https
Here instead of domain.com enter the name of the site that you work with:
 Rewrite Engine On when redirecting on HTTPS
Other variants of commands:
Redirect to https
Redirecting to https in htaccess
Adjusting redirection to the https version of the site
301 redirect from http to https
Switching redirect to https version of the website
It is also possible to set redirect 301 via .htaccess for only one page. The name .htaccess is presented as an example, replace it with the address of the right page. Use only one among presented variants:
301 redirect for one page
301 redirect for one page in htaccess


The redirects setting from http to https should be done after installing an SSL certificate to the site. Firstly, ask the hosting support, which method of redirection setting is actual in your case. If you are going to set redirect https to http manually, use the file .htaccess. Add different commands in turn, checking each of them by entering the address with http.

If all links with http forward to https without errors, the installing SSL certificate should be considered completed.
This article is a part of Serpstat's "Site Audit" tool
SEO Audit in Serpstat" title = "How to set redirect 301 from HTTP to HTTPS site version 16261788350191" />
Audit all the site or page in one click. A complete list of errors, sorted by severity, ways to resolve them and recommendations. Any frequency of verification and automatic email reports.
Run Site Audit

Learn how to get the most out of Serpstat

Want to get a personal demo, trial period or bunch of successful use cases?

Send a request and our expert will contact you ;)

Rate the article on a five-point scale

The article has already been rated by 0 people on average out of 5
Found an error? Select it and press Ctrl + Enter to tell us