Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other www to non-www WordPress (https redirect)

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #260708
    deb
    Participant

    Hello
    Sorry if this is already answered, I have a strange problem. I have redirected from www to non-www. If you do http://www.example.com then it redirects to https://example.com, which seems to work. I have changed all database URL from http to https as well (from Better Search Replace plugin). All seems working.

    The Problem:
    If we hit
    http://www.example.com/wp-content/uploads/2015/07/abc.jpg (this still loads and it does not redirect to https), if we put https, it still works, if we even to http only without www, it redirects to https but only problem is if we put http://www.example.com/wp-content/uploads/2015/07/abc.jpg then it does not redirect.

    on wp-config I have define siteurl and home as https://example.com.
    My htaccess:
    `

    BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteCond %{HTTPS} =off [OR]
    RewriteCond %{HTTP_HOST} !^example.com$
    RewriteRule ^(.*)$ “https://example.com/$1” [R=301,L]

    END WordPress

    Options -Indexes
    `

    Thank you,
    Deb

    #264256
    ankitasg
    Participant

    You are making redirection from “www” to “non www” & at the same time, you are implementing it “HTTP” to “HTTPS”. First of all I would like to make it clear that “HTTP” to “HTTPS” is not a redirection. “HTTPS” is a secured layer of a website & not a type of redirection. You need to implement every url & image with “HTTPS” if you want that only “HTTPS” version should be opened.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Other’ is closed to new topics and replies.