Mobile app version of vmapp.org
Login or Join
Phylliss660

: Redirecting https to http RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^(.*)$ http://%{HTTP_HOST}/ [R=301] # WordPress Defaults RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond

@Phylliss660

Posted in: #301Redirect #Htaccess

RewriteEngine on

RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ %{HTTP_HOST}/ [R=301]

# WordPress Defaults
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


This is what .htaccess look like for my wordpress site. I have not added SSl certificate to server and I want https to be redirected to http.

With above rule added, redirection is not really working .

Problem:

Why has google indexed https version of my website? I do not want that.

Infact I am worried if that might lead to duplicate content penalty. Besides, I undoubtedly prefer to have one and only one link leading to posts on my website. Currently google has indexed http and https version of my posts.

How do I fix this?

Edit: As suggested, I would like to make it clear that I never used SSL and yet google has somehow indexed SSL version of the website. I am using openshift and it does not allow to upload custom SSL certificate for the custom domain.

openshift provides CName your-techchick.rhcloud.com and it is available both on http and https. but it should not be interfering with my custom domain I guess>

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

2 Comments

Sorted by latest first Latest Oldest Best

 

@Alves908

A valid https connection is required for HTTPS to HTTP to work for a particular domain.
Currently, since yourtechchick.com is not available via with its own SSL certificate,
make sure that any .htaccess redirect you are applying is for your-techchick.rhcloud.com.



Why has google indexed [an] https version of my website? I do not want that.


You have several ways to access the same content: your-techchick.rhcloud.com, your-techchick.rhcloud.com and yourtechchick.com (Note that OpenShift also adds HTTPS access to an alias domain even without SSL).
your-techchick.rhcloud.com, etc. will be crawled (to some extent) by Google. This is an essential part of how Google and other search engines find content and there isn't much you can do. While it may seem intuitive to assume that example.com and example.com lead to the same content, this assumption is not necessarily made by Google. Furthermore, Google seems to prefer versions of content currently.

Using the rel=canonical link element or other methods should help prevent the the mirroring of content. You may also want to investigate Googles policies on removing outdated content.

To clear up a point of confusion, OpenShift apparently "translates" alias domains without an SSL certificate (e.g. www.example.com) so that they appear or are otherwise available as (at least to browsers and googlebot). So www.example.com/url "just works" even if there is no SSL certificate for example.com.



Finally, you may wish to consider moving to a more traditional hosting platform, one that doesn't automatically provide URLs you can't really control easily. OpenShift is awesome in many ways, but for all the hoops that seem to come with Wordpress installations in particular, a little money (likely less than a month on a shared platform) might be worth not having so many headaches.

10% popularity Vote Up Vote Down


 

@Shakeerah822

To redirect from HTTPS to HTTP, you need a HTTPS certificate for the domain. This is because the SSL/TLS 'handshake' has to happen before the rules in your .htaccess file are processed. The .htaccess rules are only processed after the secure connection is negotiated and if the secure connection does not happen, the request fails. SSL/TLS is a different protocol which encapsulates the HTTP traffic, it must happen first.

You are better off having nothing listening on port 443. Just disable it and have your server listen on port 80 only.

If your site used to be HTTPS and you no longer support the protocol, you might consider purchasing another certificate for a year and then redirecting to HTTP and adding canonical links to the head of each page, so that when you stop using HTTPS next time you don't have this same problem.

If you don't want to purchase a certificate you might try Cloudflare's free Universal SSL along with canonical HTTP links for a while, until the search results are updated to HTTP only.

If you never supported HTTPS on your site and you believe Google has somehow indexed it as HTTPS, then please post that as an edit to your question because that would be very strange problem and probably requires a different answer.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme