Let's Encrypt SSL Causing Issue with Chrome - .htaccess

I have multiple sites on my host using Let's Encrypt and all of them have had no issues. Today I'm trying to install a certificate on joescottocpa.com. The certificate will install but when I visit the site it gives me a Your connection is not private error. When I inspect the certificate it says that it is valid.
I'm able to go to the actual HTTPS address with no issues. When I type just the domain joescottocpa.comin it will sometimes work without issues, sometimes give me the error, and other times just redirect me to my hosting providers homepage.
I am using an .htaccess file to redirect the page, the code on the file is the exact same that I've used for every other site that uses HTTPS. Any help at all would be great.
Thanks!
.htaccess:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://joescottocpa.com/$1 [R,L]

The issue was with my host. Something with their settings was off that they wouldn't tell me. Needless to say this host caused issues before so I decided to switch to a new host and the issue was no longer there.

Related

Redirect Domain & Sub-domain to HTTPS

I am trying to redirect my domain and sub domain to https. I have subscribed to Wildcard SSL and made below modifications to htaccess file, as per this guide.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
I am now seeing HTTPS 'Secure Connection' on my main domain. But on sub-domain, it is still showing 'Not Secure' although HTTPS is in the domain.
What changes do I do here to redirect my subdomain as well to https 'Secure Connection'.
Looks like there is a problem with your cert installation or signing, that is why it shows "Not Secure".
You may want to try to check if the cert is correctly installed using some checker tool:
Example. https://cryptoreport.websecurity.symantec.com/checker/
Or check with your cert and hosting provider for assistance to see if it is your cert installation or signing problem.
You need to apply/check other .htaccess file(s) in your sub-domain(s) root directories. Example subdomain.yourmaindomain may be located at root/subdomain folder (need be checked - it's depended to your subdomain setting).

htaccess works with www.example.com but not example.com

I have installed Ghost, which needs nodejs to run. I'm doing this on an Apache Linux server via managed hosting. They kindly let me login with SSH access so I've been able to setup nodejs and Ghost using the standard installation instructions. I installed ghost to the root of my domain so in normal operation someone would go to example.com and it'll show them my blog. Well that's what I'd hoped.
However now when I've come to load Ghost in my browser I discover because I'm accessing it the way I am, and that Ghost doesn't do server configuration, I seem to need an htaccess file to be able to make the site reachable.
So, I have created this htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ http://127.0.0.1:65515/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:65515/$1 [P,L]
</IfModule>
With that saved to the root, if I go to example.com/ghost (the admin panel for Ghost) it works. Nothing wrong there, looks great. If however I try and visit the root, ie goto example.com, instead of showing me the index, it shows me index.js - that is, it literally loads the contents of Ghost's index.js file and displays it instead of parsing it and displaying the main index of the website.
IF however I go to www.example.com then it all works. So whatever the problem is it's because I'm not using www. in the domain.
I would prefer it to work both with or without the www in the URL though. I did try adding some solutions to redirect non-www requests to www.example.com to th ehtaccess but for some reason it still doesn't work (as in if I type example.com it doesn't redirect me to www.example.com).
I think maybe you should be using mod_proxy rather than mod_rewrite. At least, that's what I've used in the past. Apache will catch requests coming in on port 80 and then redirect them to port 65515 where your node server is listening.
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass
Like this:
ProxyPass / http://localhost:65515/
I figured it out. Wasn't anything to do with htaccess, or Ghost or nodejs or anything like it. No, instead the problem was the sodding server was caching the website. I discovered the setting to delete the cache and it all started working fine, so, this is now solved.

.HtAccess rewriting: Direct www.X.com to www.Y.com/test, whilst still showing www.X.com in the browser

I have a domainname, www.X.com that redirects (using some magic from the webhosting-company from which I bought www.X.com) any user that visits www.X.com to www.Y.com/test.
This works fine, but what I would like to happen is for the URL to remain www.X.com after the redirect. Right now, after the redirect the users URL changes to www.Y.com/test.
I'm not sure if htaccess rewriting at www.Y.com can fix this issue, so I would like to know wether this is possible and if so, how do I implement it in my .htacces file?
Regards and thanks in advance,
Robert
Instead of using the redirect tool of your hosting provider. You have to configure your domain to point to your server with a DNS A record:
Domain Type target server
www.X.com. A x.x.x.x
www.Y.com. A x.x.x.x
In your server virtualhost or via your hosting provider you need to configure both domains to point to your website.
In your .htaccess file you need ton configure domain www.X.com to point to the test directory:
RewriteCond %{HTTP_HOST} ^www.X.com$
RewriteRule ^(.*)$ /test/$1
Problem was solved by clearing out my Chrome cache; The webhost-magic HAD done the trick. Thanks mr Rockett and mr Lemaitre for your time!

Chrome won't redirect through htaccess

I want to redirect all urls without www to the www-version:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain\.tld$ [NC]
RewriteRule ^(.*)$ http://www.domain.tld/$1 [R=301,L]
that works for every browser except google chrome with subfolders. That means http://domain.tld is redirected to http://www.domain.tld like it should but when I want to access http://domain.tld/subfolder I get a 'ERR_NAME_NOT_RESOLVED' error in chrome.
Firefox, IE, Safari are working.
I have no definite answer for you, but these few hint may help you :
idea 1
Chrome uses google own's DNS, so it might be that it is trying to reach directly the ip host known as www.domain.tld for wich it does'nt find a record.
Idea 2
You might want to install fiddler and run a trace to see exactly what is exchanged between chrome and the internet. This way you'll know if your apache conf is firing the redirect correctly.
I tried typing both adresses in chrome directly : none is recognized by the omnibar (which suggests to me an issue with google dns mirrors)

Browser Warning After Removing SSL

I canceled my SSL certificate subscription but all my pages are indexed with https on search engines.
So I added a redirect to my .htaccess file
RewriteCond %{HTTPS} on
RewriteRule (.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
but I still can't go through the old https links without getting a warning:
The certificate for this website is invalid. You might be connecting to a website that is pretending to be www.flashmavi.com, which could put your confidential information at risk.
What am I doing wrong?
What am I doing wrong?
You still have SSL enabled but your certificate for the site is no longer valid. Thus browsers complain about the invalid certificate. The redirect will only be done inside the SSL connection, that is after the browser complained and the user explicitly ignored the warnings.
Your only ways are either to get a new certificate or to disable SSL completely so that browsers don't get a warning but simply fail and the search engine will update the index after a while. Note that you cannot disable SSL completely for a single host if there are other sites on the same IP address using SSL.

Resources