skip to Main Content

I have uploaded a wordpress website to Google Cloud Platform using a VM instance.

I have made the redirection of http to https . Although I can not make the redirerction of www to https, using the method of .htaccess

Can anyone help me out?

Thank you in advance!

2

Answers


  1. Chosen as BEST ANSWER

    I found the solution.

    I have made a Page Rule inside cloudflare and I redirect all the traffic from WWWW to non-WWW .

    So it is solved.


  2. Change with the following

     RewriteEngine on
        RewriteCond %{HTTP_HOST} ^yoursite.com [NC,OR]
        RewriteCond %{HTTP_HOST} ^www.yoursite.com [NC]
        RewriteRule ^(.*)$ https://www.yoursite.com/$1 [L,R=301,NC]
    

    refer: https://wpengine.com/resources/wordpress-redirects/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search