I failed to fix my this problem. Http to https redirect.

Actually recently I updated my website with SSL certificate in that everything is done.
I have added redirect code in my .htaccess file.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTPHOST}%{REQUESTURI} [L,R=301]

But only Homepage working perfect.
It’s automatically redirecting
http://www.lyricstake.com to

But all others page/post did not get redirecting.

I am using wordpress, please give me solution for post redirecting.

I want redirect my all post automatically.
http://www.digitalocean.com/community/questions to


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

2 answers


You can redirect all of your http requests to https for all pages in the domain either from the apache2.conf file

Open the editor from the terminal

sudo nano /etc/apache2/apache2.conf

and add this block of code at the end of the file

<VirtualHost *:80>
        ServerName www.lyricstake.com
        Redirect "/" "https://www.lyricstake.com/"

You can also do this from the virtual host file

sudo nano /etc/apache2/sites-available/default

Add the following two lines inside the <VirtualHost *:80> tags

        ServerName www.lyricstake.com
        Redirect "/" "https://www.lyricstake.com/"

Follow this guide if you get into trouble:
Configure Apache

Good luck

by Josh Barnett
SSL is a web protocol used to encrypt a site's information and create a more secure connection. The certificate system also assists users in verifying the identity of the sites that they are connecting with. In this guide, we will show you how to set up a self-signed SSL certificate for use with an Apache web server on a CentOS 7 VPS.
  • Hello,

    Thanks for reply and thanks to give solution.

    But it’s not work.

    I had use both method, but it’s didn’t redirecting.

    Only Homepage working.
    Other pages not recreation.

    i really tired to fix it. I have done everything but all failed.

    Please check again my issues
    Give me a hard solution.



You can try with some of the following rules:

The following forces any http request to be rewritten using https. For example, the following code forces a request to http://example.com to load https://example.com. It also forces directly linked resources (images, css, etc.) to use https:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

The below code when added to an .htaccess file will automatically redirect any traffic destined for http: to https:

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

Let me know how it goes.


Submit an Answer