LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Redirect all traffic to https FQDN (https://www.linuxquestions.org/questions/linux-server-73/redirect-all-traffic-to-https-fqdn-4175580807/)

ebcdic 05-26-2016 11:45 PM

Redirect all traffic to https FQDN
 
Hi,

I'm using RHEL, and I have a SSL cert that points to https://websitename.domain.com

The problem is, if you go to either http://websitename or https://websitename or http://servername https://servername it all goes to an invalid certificate which is showing as a vulnerability.

Is there a way for me to do something like a .htaccess redirect so anything will be redirected to https://websitename.domain.com ?

If someone can help me with the code for this I'd appreciate it greatly.

Thanks!

Habitual 05-27-2016 01:17 PM

2 posts since 2007, oh boy.
Hi and Hello.
Is the SSL Cert for https://websitename.domain.com a Wildcard Cert?
Self-signed, Ca, or other...?

tomcat, apache, java, nginx, litespeed are all popular web servers.
Pick one. :)

Armchair Admins:
Yes, htaccess implies apache...duh.

ebcdic 05-27-2016 02:36 PM

Thank you for the reply, appreciate it.

The certs are signed by an internal CA, not a wildcard cert, stored in a certificates.ks file.

It's running httpd-2.2.3-91.el5 on RHEL which should be Apache :)

Just for fun, here is the guide for how I generate the csr, then send them off to the ca, and then import them. I have two do two certs.

https://kb.vmware.com/selfservice/mi...rnalId=1026309

Any help would be appreciated. Thanks again. :cool:

btmiller 05-29-2016 08:23 AM

I've always just handled this situation with an HTTP redirect. For example, in the Apache VirtualHost for websitename, you can have:

Code:

Redirect permanent / https://websitename.domain.com/
This will redirect all requests handled by that virtual host to the virtual host with the correct SSL certificate.


All times are GMT -5. The time now is 12:35 PM.