• Hi,

    I am trying to redirect a non-www version of my website to https://www.website.com

    Currently it is set to https://website.com in my WP-admin

    I have tried the following in my htaccess file which works:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.website.co.uk$ [NC]
    RewriteRule ^(.*)$ https://www.website.co.uk/$1 [R=301,L]
    
    RewriteCond %{HTTPS} !^on$
    RewriteRule (.*) https://www.website.co.uk/$1 [R,L]

    but I get this error when it redirects:

    “The page isn’t redirecting properly

    An error occurred during a connection to http://www.website.co.uk.

    This problem can sometimes be caused by disabling or refusing to accept cookies.”

    Can anyone tell me why this would be? Is it because the URL in my wp-admin is not using http://www.?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The htaccess code for this could vary from provider to provider as it depends on the server configuration. I would suggest contacting your host and asking them for their input on how to do this via htaccess. If you are not able to assist because they claim it is outside of their technical support terms try using this plugin: https://ww.wp.xz.cn/plugins/really-simple-ssl/

    Hope this helps. Once you find a solution that you are happy with please tag the thread as resolved.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Moved to Fixing WordPress, this is not a Developing with WordPress topic.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘redirect non-www to www https’ is closed to new replies.