Question

How can redirect my all posts/page from Http to Https

Hello,

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://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

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

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. Example: http://www.digitalocean.com/community/questions to https://www.digitalocean.com/community/questions

Thanks Imran

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

HTTPS Redirection in Apache Login to your Apache server and go to the path where it’s installed. Go to the conf folder and take a backup of httpd.conf file Open httpd.conf using your vi editor (choose your favorite editor) Ensure mod_rewrite.so module is loaded LoadModule rewrite_module modules/mod_rewrite.soCopy If you see above line is commented then uncomment it Add the following at the end of the file RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}Copy Restart Apache web server to test it. A configured website should be able to redirect and accessible on https.

HTTPS Redirection in Nginx Login to the Nginx web server and take a backup of nginx.conf or default.conf file (whatever file you are using for server directive)

Add the following in server directive return 301 https://$server_name$request_uri;Copy Save the file and restart Nginx web server. Restart Nginx to test the site.

HTTP Redirection in Cloudflare If you are leveraging Cloudflare for performance and security, then having a website through HTTPS is very easy.

Login to Cloudflare >> select the site Go to SSL/TLS tab >> Edge Certificates cloudflare-https

Ensure it turned ON There is another way, page rules.

Go to Page Rules Click “Create Page Rule” Enter the URL (put the asterisk, so redirection happens for all the URI) Click “Add a Setting” and select “Always Use HTTPS” from the drop-down cloudflare-pagerules

Click “Save and Deploy” It will take a few seconds, and you are all set to have your website accessible through https. After using Cloudflare, if your site breaks due to mixed content, then check out the following guide.

[www.lyrics-hindi-songs.in]

HTTPS Redirection in Apache Login to your Apache server and go to the path where it’s installed. Go to the conf folder and take a backup of httpd.conf file Open httpd.conf using your vi editor (choose your favorite editor) Ensure mod_rewrite.so module is loaded LoadModule rewrite_module modules/mod_rewrite.soCopy If you see above line is commented then uncomment it Add the following at the end of the file RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}Copy Restart Apache web server to test it. A configured website should be able to redirect and accessible on https.

HTTPS Redirection in Nginx Login to the Nginx web server and take a backup of nginx.conf or default.conf file (whatever file you are using for server directive)

Add the following in server directive return 301 https://$server_name$request_uri;Copy Save the file and restart Nginx web server. Restart Nginx to test the site.

HTTP Redirection in Cloudflare If you are leveraging Cloudflare for performance and security, then having a website through HTTPS is very easy.

Login to Cloudflare >> select the site Go to SSL/TLS tab >> Edge Certificates cloudflare-https

Ensure it turned ON There is another way, page rules.

Go to Page Rules Click “Create Page Rule” Enter the URL (put the asterisk, so redirection happens for all the URI) Click “Add a Setting” and select “Always Use HTTPS” from the drop-down cloudflare-pagerules

Click “Save and Deploy” It will take a few seconds, and you are all set to have your website accessible through https. After using Cloudflare, if your site breaks due to mixed content, then check out the following guide.

www.lyrics-hindi-songs.in

HTTPS Redirection in Apache

Login to your Apache server and go to the path where it’s installed. Go to the conf folder and take a backup of httpd.conf file Open httpd.conf using your vi editor (choose your favorite editor) Ensure mod_rewrite.so module is loaded LoadModule rewrite_module modules/mod_rewrite.soCopy If you see above line is commented then uncomment it Add the following at the end of the file RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}Copy Restart Apache web server to test it. A configured website should be able to redirect and accessible on https.

HTTPS Redirection in Nginx Login to the Nginx web server and take a backup of nginx.conf or default.conf file (whatever file you are using for server directive)

Add the following in server directive return 301 https://$server_name$request_uri;Copy Save the file and restart Nginx web server. Restart Nginx to test the site.

HTTP Redirection in Cloudflare If you are leveraging Cloudflare for performance and security, then having a website through HTTPS is very easy.

Login to Cloudflare >> select the site Go to SSL/TLS tab >> Edge Certificates cloudflare-https

Ensure it turned ON There is another way, page rules.

Go to Page Rules Click “Create Page Rule” Enter the URL (put the asterisk, so redirection happens for all the URI) Click “Add a Setting” and select “Always Use HTTPS” from the drop-down cloudflare-pagerules

Click “Save and Deploy” It will take a few seconds, and you are all set to have your website accessible through https. After using Cloudflare, if your site breaks due to mixed content, then check out the following guide.

Lyrics Hindi Songs[https:/lyrics-hindi-songs.in```<a href=“https:// www.lyrics-hindi-songs.in/”>Lyrics Hindi Songs</a>