We have a rule that rewrites all HTTP to HTTPS. That's fine.
Then we have the *:443
host that also works.
I am trying to make a rule that will change any access to the server to the FQDN.
The reason why this needs to happen is the certificate of the server is the FQDN so when a user browses to the shortened URL it flags that certificate may not be secure.
The issue I've got is I've tried various combinations of RewriteCond
in Apache they all seem to work for Firefox BUT NOT in Chromium. (Not Chrome)
So for example:
<VirtualHost *:80>
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName example.com.web.local
SSLEngine on
SSLCertificateFile xxxx/xxxxx/xxxxxx/xxxx.crt
SSLCertificateKeyFile xxxx/xxxxx/xxxxxx/xxxx.key
RewriteEngine On
RewriteCond %{HTTP_HOST} !^example.com.web.local$ [NC]
RewriteRule ^(.*) https://example.com.web.local/$1 [L,R]
Actually two issues......
- Works in Firefox not in Chromium on test.
- Same Apache config works on test server but not on production.
As far as I can see the RewriteCond
doesn't get applied in the 443 part but the 80 part is working.
But I think the first thing to tackle is why it works in Firefox and not Chromium.