# \[SOLVED\] Redirect http:// http://www. and https:// all to one https://www

**URL:** <https://onehack.st/t/solved-redirect-http-http-www-and-https-all-to-one-https-www/68639>\
**Category:** Tutorials & Methods\
**Tags:** solved\
**Created:** [February 6, 2020, 10:05am UTC](https://onehack.st/t/solved-redirect-http-http-www-and-https-all-to-one-https-www/68639 "2020-02-06T10:05:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mRr0b0t](https://onehack.st/user_avatar/onehack.st/mrr0b0t/32/32190_2.png) [@mRr0b0t](https://onehack.st/u/mRr0b0t)\
**Post date:** [February 6, 2020, 10:05am UTC](https://onehack.st/t/solved-redirect-http-http-www-and-https-all-to-one-https-www/68639/1 "2020-02-06T10:05:05Z")

</div>

Need help regarding redirect as in title i want to redirect all **http://** **[http://www](http://www).** and **https://** all to one **[https://www](https://www).**. Godaddy give this code

# BEGIN GD-SSL
Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{HTTP\_USER\_AGENT} ^(.+)$ RewriteCond %{SERVER\_NAME} ^coolexample\.com$ [OR] RewriteCond %{SERVER\_NAME} ^www\.coolexample\.com$ RewriteRule .\* https://%{SERVER\_NAME}%{REQUEST\_URI} [R=301,L] Header add Strict-Transport-Security "max-age=300" # END GD-SSL
# BEGIN WordPress
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST\_FILENAME} !-f RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress

for .htaccess file but it redirect http:// to https:// and [http://www](http://www) to [https://www](https://www)

---

<div class="post-metadata">

**Author:** ![w3Abhishek](https://onehack.st/user_avatar/onehack.st/w3abhishek/32/50613_2.png) [@w3Abhishek](https://onehack.st/u/w3Abhishek)\
**Post date:** [February 6, 2020, 11:48am UTC](https://onehack.st/t/solved-redirect-http-http-www-and-https-all-to-one-https-www/68639/2 "2020-02-06T11:48:33Z")

</div>

Try CloudFlare Page Rules

---

<div class="post-metadata">

**Author:** ![HackedHack](https://onehack.st/user_avatar/onehack.st/hackedhack/32/26738_2.png) [@HackedHack](https://onehack.st/u/HackedHack)\
**Post date:** [February 6, 2020, 12:13pm UTC](https://onehack.st/t/solved-redirect-http-http-www-and-https-all-to-one-https-www/68639/3 "2020-02-06T12:13:06Z")

</div>

If it is a wordpress then you can use this plugin to redirect to SSL

> **[Really Simple Security – Simple and Performant Security (formerly Really...](https://wordpress.org/plugins/really-simple-ssl/)**
>
> Easily improve site security with WordPress Hardening, Two-Factor Authentication (2FA), Login Protection, Vulnerability Detection and SSL certificate.

Or you can edit your .htaccess to redirect to ssl

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.\*)$ https://%{HTTP\_HOST}%{REQUEST\_URI} [L,R=301]

---

<div class="post-metadata">

**Author:** ![mRr0b0t](https://onehack.st/user_avatar/onehack.st/mrr0b0t/32/32190_2.png) [@mRr0b0t](https://onehack.st/u/mRr0b0t)\
**Post date:** [February 6, 2020, 12:45pm UTC](https://onehack.st/t/solved-redirect-http-http-www-and-https-all-to-one-https-www/68639/4 "2020-02-06T12:45:32Z")

</div>

This plugin is very good and i’m using it on one of my website hosted on google cloud but for another website i’m using goDaddy hosting and their ssl managing service is very bad i tried many codes nothing work and there are already many plugins install if possible i don’t want to use more plugins btw thanks

---

<div class="post-metadata">

**Author:** ![HackedHack](https://onehack.st/user_avatar/onehack.st/hackedhack/32/26738_2.png) [@HackedHack](https://onehack.st/u/HackedHack)\
**Post date:** [February 6, 2020, 1:32pm UTC](https://onehack.st/t/solved-redirect-http-http-www-and-https-all-to-one-https-www/68639/5 "2020-02-06T13:32:48Z")

</div>

What is the error you are getting .

PM me if possible

---

<div class="post-metadata">

**Author:** ![TheJoker](https://onehack.st/user_avatar/onehack.st/thejoker/32/22660_2.png) [@TheJoker](https://onehack.st/u/TheJoker)\
**Post date:** [February 6, 2020, 4:37pm UTC](https://onehack.st/t/solved-redirect-http-http-www-and-https-all-to-one-https-www/68639/6 "2020-02-06T16:37:23Z")

</div>

You can use .htaccess rules or WordPress function [Function Reference/wp redirect](https://codex.wordpress.org/Function_Reference/wp_redirect)to set redirect rules.

* * *

**Setting Up 301 Redirects in WordPress using .htaccess**

Using the web server configuration file .htaccess, WordPress users can set up 301 redirects that are fast.

Please keep in mind that a small mistake in your .htaccess code can make your WordPress site inaccessible, and it may start showing Internal Server Error.

That’s why it is important that you backup your .htaccess file before making any changes.

To edit your .htaccess file, you will need to connect to your website using an FTP client. The .htaccess file resides in your WordPress site’s root directory.

If you can’t see your .htaccess file there, then you need to force your FTP client to show hidden files. (See why you can’t find .htaccess file on your WordPress site.)

You can edit .htaccess file in any plain text editor like Notepad.

Here is a simple redirect, where we are trying to send a user visiting an old post to a new post.

`RewriteEngine On
Redirect 301 /a-very-old-post/ http://yoursite.com/a-very-new-post/`

You can add the code above preferably at the end of your .htaccess file.

* * *

[https://www.seoramanarora.com/setup-301-redirect-in-wordpress-without-plugin/](https://www.seoramanarora.com/setup-301-redirect-in-wordpress-without-plugin/)
