0

My site is sometimes shown in Google as https://www.example.com. But I don't have a SSL certificate (and it's not needed in my view).

How do I redirect them to HTTP?

My current .htaccess is:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301]

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

When I type https://example.com, it redirects to http://www.example.com. But when I type https://www.example.com, it doesn't do anything.

MrWhite
  • 43,179
  • 8
  • 60
  • 84
Vinnie Van Rooij
  • 121
  • 4
  • 10
  • You need anchors on your rule, it will leave port 443 on your HTTP_HOST so won't work anyway though. – 123 Sep 14 '16 at 09:40
  • `but I dont have a SSL certificate and its not needed in my view` Read [this](http://mashable.com/2011/05/31/https-web-security/#vNxXdyIJusqb) why you should always use HTTPS. You can get free certificates from Let's Encrypt and StartSSL. – Charlotte Dunois Sep 14 '16 at 09:47
  • Thanks 123, but I don't know how to fix this? (and I'm not experienced enough to really know how these things fully operate). – Vinnie Van Rooij Sep 14 '16 at 14:59
  • "I don't have a SSL ... When I type `https://example.com`, it redirects..." - if you aren't getting a browser warning then you must have an SSL cert somewhere?! And for Google to index `https://...` you must have a valid SSL cert. (?!) Or if you don't have the cert directly on your site then you are using some kind of frontend proxy that has an SSL cert? – MrWhite Dec 22 '16 at 02:38

2 Answers2

0

Write this code in htaccess file.

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Shashank Sharma
  • 585
  • 3
  • 14
  • That seems to be exactly what I have in my original post at the top. Apart from the ,L. I've read that ,L gives the visitor the idea that it is the end of the code, which it isn't. So there shouldn't be an ,L at the end? – Vinnie Van Rooij Sep 14 '16 at 15:01
  • @VinnieVanRooij The `L` flags prevents the URL from being rewritten by the front controller before the request is redirected (which is important). It doesn't "gives the visitor the idea that it is the end of the code". – MrWhite Dec 22 '16 at 02:44
0

Your redirection code seems perfect to me. You may be perplexed at another area.

As per my knowledge, there may be an issue with Google Webmasters tools alternatively we can say Google Search Console. To track your website performance, you might have entered website URL with HTTPS (https://www.example.com) and that might be indicating Google search to display HTTPS URLs for your website. Search Console gives significant idea to Google Search to display proper URL in organic search result.

Now let us talk about importance of SSL certificate for website. Whether you've eCommerce website or a simple blog, every data traveling between browser and server needs to be protected, SSL certificate gives that facility. If you are thinking, why does my blog need SSL when it is not processing payment or allowing users to login?

Let me clear your view: It is obvious that every website owners want to rank top of the Google, here also SSL can be helpful as Google has given elucidated intention to push organic ranking for SSL secured website. So it is advisable to choose any cheap price certificate for your website instead of changing URL on Search Console.

Useful URLs:

Https to http redirect using htaccess

https://www.cheapsslshop.com/blog/google-says-companies-frivolous-attitude-on-https

https://webmasters.googleblog.com/2014/08/https-as-ranking-signal.html

Community
  • 1
  • 1
Gunjan Tripathi
  • 298
  • 1
  • 5
  • Not switching to SSL thanks. I double checked Google Search Console, but its set to http, not https. So I simply don't understand where the https comes from. Nothing in Google, or the website/server has anything that leads to https... – Vinnie Van Rooij Sep 21 '16 at 12:37