• zaidapicazo

    (@zaidapicazogmailcom)


    Hello!

    I’ve got a problem redirecting to https: I’ve just the certificated with my server and I’m trying to change the .htaccess but it is giving me problems.
    First I changed in WordPress panel, in Settings/General http to https, in my case
    https://sierraysol.com to https://sierraysol.com

    After I went to the .htaccess file where I had:

    #Redirect 301 /es/ https://www.sierraysol.com/guided-hiking-tours-spain/
    #Redirect 301 /en/ https://www.sierraysol.com/guided-hiking-tours-spain/
    # 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]
    </IfModule>
    
    # END WordPress

    and I add the two lines:

    #Redirect 301 /es/ https://www.sierraysol.com/guided-hiking-tours-spain/
    #Redirect 301 /en/ https://www.sierraysol.com/guided-hiking-tours-spain/
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://sierraysol.com/$1 [R,L]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    When I did this, I went to the website: https://sierraysol.com and it says

    redirect loop

    and it doesn’t work and If I leave the .htaccess as at the beginning, it shows the website without https.
    The only parts where https works is in the login and admin panel, the rest https doesn’t work and I don’t know what else to change.

    I would be very grateful if someone can help me.

    Thank you very much in advance

    Best,
    Zaida

Viewing 2 replies - 1 through 2 (of 2 total)
  • Zaida,

    Have you set WordPress up to force SSL within wp-config.php? (See link below.)

    https://codex.www.ads-software.com/Administration_Over_SSL

    Thread Starter zaidapicazo

    (@zaidapicazogmailcom)

    Thanks for your reply Augustin56

    I set

    if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
           $_SERVER['HTTPS']='on';

    in wp-config.php but it still does not work …

    If I put in .htaccess:

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

    I have loop redirect error and If i don’t put this two lines in .htaccess file, it goes to unsecured http instead to https.

    Do I need to configure anything else in WP to be able to have ssl connection?
    Thanks a lot

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘loop redirect problem when redirect http to https at htaccess’ is closed to new replies.