WordPress.org

Forums

SSL - Getting http instead of https (19 posts)

  1. Oded Ben-Ami
    Member
    Posted 2 years ago #

    Hi,

    I hope you can help me with this problem.

    I have SSL installed.

    When I enter URLs in the browser (with the exception of Google Chrome), for example:
    odedbenami.com/consultation
    odedbenami.com/disclaimer

    It automatically becomes preceded with an http instead of https. If I manually change this to https, it will change without trouble. However, I'm unable to effect the initial addition from http to https.

    My WordPress settings > General
    are as follows:

    WordPress Address (URL):
    https://odedbenami.com/wordpress

    Site Address (URL):
    https://odedbenami.com

    As you can see, they are both with https.

    Can anyone help me?

    ~ Oded Ben-Ami

  2. Greg Stewart
    Moderator
    Posted 2 years ago #

    If you're looking to force SSL on all pages and have mod_rewrite enabled, you can add this code to your .htaccess file:

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]
  3. supah
    Member
    Posted 2 years ago #

    this works for loading pages, but how do i modify the calling of things like web fonts and style sheets? (settings are set for https, rewrite in htaccess is there, but the pages are missing their style, and come up as non-secure at whynopadlock.com)

  4. Greg Stewart
    Moderator
    Posted 2 years ago #

    I looked at your page, and the styles appear to be there, everything loads ok, but I see the rewrite isn't grabbing a URL in your themes stylesheet, so you have a mixed-security page.

    Try this instead:

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  5. Oded Ben-Ami
    Member
    Posted 2 years ago #

    jgs,

    Below is my .htaccess.
    Can you please tell me where to insert your code.

    Thank you

    Options +FollowSymLinks
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://odedbenami.com/$1 [R,L]

    </IfModule>

    # END WordPress

  6. Oded Ben-Ami
    Member
    Posted 2 years ago #

    jgs,

    I just realized that the folks at my hosting company completely changed the content of my .htaccess file, perhaps they took out something that they shouldn't have.

    Below is the .htaccess file before they modified it.
    Could you please tell me wether I should use the old or the new/modified and where to insert the code that you posted.

    Thank you

    Options +FollowSymLinks
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^odedbenami\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.odedbenami\.com$
    RewriteRule ^(.*)$ "https\:\/\/odedbenami\.com\/$1" [R=301,L]
    #RewriteBase /
    #RewriteRule ^index\.php$ - [L]
    #RewriteCond %{REQUEST_FILENAME} !-f
    #RewriteCond %{REQUEST_FILENAME} !-d
    #RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

  7. Greg Stewart
    Moderator
    Posted 2 years ago #

    Try this:

    Options +FollowSymLinks
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    </IfModule>
    # END WordPress
  8. Oded Ben-Ami
    Member
    Posted 2 years ago #

    I don't see any change.

  9. Greg Stewart
    Moderator
    Posted 2 years ago #

    Where is the .htaccess file you're modifying located?

  10. Oded Ben-Ami
    Member
    Posted 2 years ago #

    public_html

  11. Greg Stewart
    Moderator
    Posted 2 years ago #

    Your /wordpress/index.php file appears to be missing.

  12. Oded Ben-Ami
    Member
    Posted 2 years ago #

    Can you help me fix that?

  13. Greg Stewart
    Moderator
    Posted 2 years ago #

    Do you still have the zip file you installed from? If so, you could put a fresh copy of the index.php file in your WordPress directory.

  14. Oded Ben-Ami
    Member
    Posted 2 years ago #

    I don't.
    Only a few days ago I updated from wordpress 3.5 to 3.5.1, but I used the automatic option, without downloading the zip.

  15. Greg Stewart
    Moderator
    Posted 2 years ago #

    If you're using 3.5.1 you can download the archive here: http://wordpress.org/latest.zip

    Extract the files on your machine, then FTP the index.php file into your /wordpress/ directory.

  16. Oded Ben-Ami
    Member
    Posted 2 years ago #

    I just did.
    Here's what's happening;
    if I enter:
    http://odedbenami.com
    it changes it to https

    but if I enter any of the pages, say
    http://odedbenami.com/consultation
    or without the http:
    odedbenami.com/consultation

    https is not enforced.

  17. Greg Stewart
    Moderator
    Posted 2 years ago #

    Let's try reversing the order of the rules, putting the SSL directives at the top. It seems like the rewrites may be stepping on each other.

    Options +FollowSymLinks
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
  18. Oded Ben-Ami
    Member
    Posted 2 years ago #

    jgs,

    You have solved my problem.
    Thank you so much for your time, patience and goodwill.

    ~ Oded Ben-Ami

  19. Greg Stewart
    Moderator
    Posted 2 years ago #

    Very happy to hear it's working now.

    Cheers.

Topic Closed

This topic has been closed to new replies.

About this Topic