WordPress.org

Ready to get started?Download WordPress

Forums

301 redirect from http to https (6 posts)

  1. silly2
    Member
    Posted 7 years ago #

    I have just installed a SSL certificate on my site. I changed my address from http to https inder the admin>general options, but now my PR does not exist. How do I set up a 301 redirect from http to https in my .htaccess file. I am not savy on this so please be nice. This is my .htaccess file now....

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

    # END WordPress

  2. pho
    Member
    Posted 7 years ago #

    I am looking for an answer for the same problem. To make things worse, I would like to redirect only a couple of pages in my site.

  3. places
    Member
    Posted 7 years ago #

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]

  4. pho
    Member
    Posted 7 years ago #

    It works to redirect a whole http site to a https site.

    Is it possible to redirect only one or two pages??

  5. places
    Member
    Posted 7 years ago #

    If you just want to redirect one or two pages set the rewrite rules like

    RewriteRule ^page1(.*) https://%{SERVER_NAME}/page1$1 [R,L]

  6. pho
    Member
    Posted 7 years ago #

    Yes! It works!! Thank you, places!!

Topic Closed

This topic has been closed to new replies.

About this Topic