• 301 Redirect

    • views 1379

    Hi! I`ve combed through the entire Internet and can`t find the answer I need. Who can tell me what to do? Here`s my problem. My URL should be https://www.my-site.ru Here`s my question. Do I remove the old site from http to http: // www when going to HTTPS from www?

    Logically, when switching to HTTPS, the site with http is no longer involved in the search. The site with HTTPS is a completely different resource - do we need the the old redirect anymore? Do we need to configure 301 redirect from http to https:// www?

    1) Or do we leave the old splice from http to http:// www and make the second redirect from http to https since the www redirect already exists and automatically submits to https prefix www?

    2) Or do I do a 301 redirect with http on https and then with https on https://www -?

    What do I do? And can you write the code. Thank you in advance!!

    Also, I have the following variant.

    RewriteEngine On RewriteCond %{REQUEST_FILENAME} !robots\\\\.txt RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} RewriteCond %{HTTP_HOST} !^www\\\\.(.*) RewriteRule ^(.*)$ http://www.%1/$1

    And is a gap between redirects necessary or each redirect begins with RewriteEngine On --?

    Solutions (1)
    It will be better to perform redirection from http to https, and then, if necessary, from https://example.ru to https://www.example.ru. The "RewriteEngine On" directive is prescribed just once. Each redirect directive is placed on a separate line.
We do our best for you!
Rate the article
Tell the world about it

Users (0) 0 of 5

  • In order to provide you with the best online experience this website uses personal data (cookies, IP, email, photo, name, website, etc). By using our website, you agree to our use of your personal data. More info we receive some monetary compensation from hosting companies, however, this does not influence their positions in our ratings, test results, the direction or conclusions of our reviews in any way. We use this amount to provide better services, improve our website, to cover hosting testing account fees and team salaries. Ok

  • easy


    We ban anonymous users since 2016


    We do not delete reviews for money
    We do not sell rating positions
    We make cheating attempts almost impossible


    We test the hosting thoroughly and publish professional overviews
  • Rewards for reviews