Thread: HTTP to HTTPS

    #1
  1. No Profile Picture
    Newbie
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Jun 2017
    Posts
    4
    Rep Power
    0

    HTTP to HTTPS


    Hello,

    I have purchased the SSL certificate for my website.

    I have tries too many times to apply it... by adding htaccess file...

    But my site is not redirecting from http to https.

    Yes, site is working on both URLs http & https but not redirecting.

    what should I do?
  2. #2
  3. Contributing User
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Jun 2012
    Posts
    365
    Rep Power
    333
    In general:
    There are a number of steps, hard to comment without having more details on your server, etc.... but here is a guide that looks pretty good to help you troubleshoot how you have the SSL configured for several popular SMB hosts: https://www.digitalocean.com/communi...cate-authority . Also, if you're hosting somewhere, you can call your tech support and they may be able to help you troubleshoot over the phone...

    redirection:
    One test to run is to see if there is both an http or https version of pages, if both versions exist then there may be an issue with your redirect rules
    "...using this: sages act out of constructs but they do not rely on them"
  4. #3
  5. No Profile Picture
    Moderator
    SEO Chat Good Citizen (1000 - 1499 posts)

    Join Date
    Sep 2016
    Location
    USA
    Posts
    1,135
    Rep Power
    2345
    On MS Servers
    Install the URL Rewrite module. IIS 7 and higher
    edit your configuration file
    Code:
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
            <rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
            <match url="(.*)" />
            <conditions logicalGrouping="MatchAny">
              <add input="{SERVER_PORT_SECURE}" pattern="^0$" />
            </conditions>
            <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
            </rule>
          </rules>
        </rewrite>
      </system.webServer>
    </configuration>
    If on a Linux server
    Edit your .htaccess file add this
    Code:
    RewriteEngine on
    
    #Use these lines if you want all urls www and https
    RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
    RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [L,R=301,NC]
    
    #Or use this if you want all urls non www and https
    #RewriteCond %{HTTP_HOST} ^www\.yourdomain.com [NC]
    #RewriteRule ^(.*)$ https://yourdomain.com/$1 [L,R=301,NC]
    
    #This catches any urls that are not https, 
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    Edited to add

    If you are on a WordPress site, you need to add a plugin, there are many out there to manage the https settings and disregard the changes to the .htaccess file.
    Last edited by KnowOneSpecial; Aug 10th, 2017 at 01:47 PM.

Similar Threads

  1. Which converts better? http,https, http://www, https://www
    By ThomasHarvey in forum Search Engine Optimization
    Replies: 8
    Last Post: Jul 27th, 2017, 09:32 AM
  2. https and http - Spider Simulator not crawling the https website
    By travelauto in forum New User SEO Questions and Answers
    Replies: 1
    Last Post: Aug 25th, 2015, 12:27 PM
  3. Http or https ?
    By volkswagen02 in forum Google Optimization
    Replies: 2
    Last Post: Apr 4th, 2012, 05:54 AM
  4. HTTP vs HTTPS
    By Harmstra in forum SEO Help (General Chat)
    Replies: 2
    Last Post: Apr 4th, 2009, 11:46 AM
  5. Http: and https
    By Hilary in forum Google Optimization
    Replies: 2
    Last Post: Mar 20th, 2009, 08:08 AM

IMN logo majestic logo threadwatch logo seochat tools logo