Redirect 301 / https://www.newsite.org
You are missing a trailing slash on the end of the target URL (after the hostname). It should be like this:
Redirect 301 / https://www.newsite.org/
The Redirect
directive is prefix-matching. Everything after the match (a single slash in this case) is copied onto the end of the target URL.
(The Redirect
directive is for redirecting entire branches of URLs - or entire sites - not just individual URLs.)
So, without the trailing slash on the target, when you request a URL like example.com/foo
it will redirect to https://www.newsite.orgfoo
, which will likely result in domain resolution errors, SSL errors, etc. (The malformed redirect should be obvious by looking at the URL in the browser's address bar.)
With the trailing slash then foo
is copied onto the end of https://www.newsite.org/
resulting in https://www.newsite.org/foo
- all good.
Requests for the document root exampel.com/
"work" because it's simply a redirect to https://www.newsite.org
. (Although even in this case, the browser is having to "fix" the target URL by appending a slash after the hostname.)
- only via Google search results
It's quite likely the URL you are clicking on is not just example.com/
.
- now
You seem to be looking just at the "SSL Certificate" aspect, but it's probably a completely different domain.
301 (permanent) redirects are also persistently cached by the browser. So, you might also be seeing a mix of old (cached) redirects/responses.
This only happens in Chrome and Safari, the redirect works in Firefox.
I don't believe Firefox is capable of "correcting" a request for something like https://www.newsite.orgfoo
, so this is more likely to be a difference in caching. (?)
TIP: Test with 302 (temporary) redirects to avoid potential caching issues.
Reference:
.htaccess
file unconditionally. It is impossible to know what is going on without more context. What else do you have in your.htaccess
file? Do you have other servers or virtual hosts with other.htaccess
files? What is your configuration that is related to SSL?example.com/foo
(ie. anything but the homepage), regardless of browser. "2. only via Google search results." - Probably because the URL is notexample.com/
.www
part to see if that makes a difference.