Google has listed me as https:// - .htaccess

Has anyone come across such an issue before? Where there site has been listed at https instead of http:
My homepage has been listed as https:// so when they visit it they get a security warning, i have never had and never mentioned ssl anywhere on my website at any point.
Does anyone have any ideas what this could be and how i can rectify it?
Is there any possible way i can redirect anyone that ever goes to https to http.
I have already tried putting in 301 redirects with no luck.
Thank you!

You can use this rule in root .htaccess:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,NE,R=301]

Related

.htaccess redirect with multi-subdomain

I'm currently using this rule to redirect traffic (except one url) to a new url.
It works fine when using a non www url like "subdomain.olddomain.com" but when accessing it with www like "www.subdomain.olddomain.com", I get a redirection error. This is the rule i use:
RewriteCond %{REQUEST_URI} !^/exception($|/)
RewriteRule ^(.*)$ https://www.newdomain.com/ [R=301,L]
What am I missing here? I'm not an expert in any way with htaccess… Thank you!
PS: I already searched for answeres but couldn't find any matching my subdomain issue.
Seems like I had to change some domain settings, the rule above works as expected.

How to redirect all HTTPs requests to HTTP

I know that people usually ask how to redirect to https, but i have an opposite issue. I check my stats and for a reason that i don't know i get some visits to https:// page, which i don't have.
So my question is how can i redirect all my https requests to http ?
I'm on VPS
Linux version 2.6.32-042stab116.1 , CentOS release 6.7 (Final)
I tried some codes that i find here, but they unfortunately don't work
F.e. this
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
Unfortunately that's not really possible. The SSL handshake occurs before any redirects happen, so no redirect will get around that issue. Really your only option is to look into getting a cheap certificate.
Actually, you can force HTTP, you also almost had it correct. Use this in your .htaccess:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Redirect sub directory to diff domain using same subdirectory

There are many posts on this issue, but I couldn't find the answer.
When I tried to change htaccess it caused problems.
www.xyz.com points to www.xyz.com/mysite
This works great and user only sees www.xyz.com
Unfortunately if someone types www.xyz.com/mysite they also get the same site, but they see www.xyz.com/mysite
Ideally when they type www.xyz.com/mysite it will show www.xyz.com.
Thank You for your help
You can use this redirect rule inside /mysite/.htaccess:
RewriteEngine On
RewriteCond %{THE_REQUEST} /mysite [NC]
RewriteRule ^ / [L,R=302,NE]
Solved it. This was not a htaccess issue. It was a WordPress issue. I did not change the WordPress Address (URL) and Site Address (URL) in the General Settings to the new url.

.htaccess 301 redirect to www issue

I am trying to redirect all from non-www to www. So example.com redirects to www.example.com
I enabled Rewrite Engine in Apache and added this to .htaccess:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule ^(.*) http://www.example.com/$1 [R=301]
At first look everything worked perfectly. But when trying to use my website's log in form to view areas of the site accessible only to logged in users it just appears to refresh the page. Nothing happens.
I've been trying to fix this for quite a while and haven't found any similar problems. Any help is appreciated! Thanks.
Silly me. Somewhere I declared the website as a variable in the form of example.com. Changed it and it works now.

sub domain htaccess redirect to HTTPS URL

I've been trying to redirect my subdomain buynow.mydomain.info to the product link which is https://www.2checkout.com/checkout/purchase?sid=******&quantity=1&product_id=1.
I tried the simple .htaccess line
Redirect 301 / https://www.2checkout.com/checkout/purchase?sid=******&quantity=1&product_id=1
but it doesn't work, it only redirects to https://www.2checkout.com/checkout/purchase without mentioning my product as it ignores the rest of the URL ?sid=******&quantity=1&product_id=1
I thought it might be a problem with the link which is HTTPS, but I can't solve it, I hope you guys could help me, thanks.
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) https://www.2checkout.com/checkout/purchase?sid=******&quantity=1&product_id=1 [R=301]

Resources