Server's Hostname

donkeyKICK

Verified User
Joined
Jul 24, 2007
Messages
422
I've been playing with SSL certificates, and noticed a problem I am having. If I enable SSL on my DA server and set the hostname to server.example.com, then all emails going out from my server include a link to https://server.example.com:2222/stuff... That's great and I create a certificate with Common Name of server.example.com. Cool.

Now, the redirect when I type www.example.com/config goes to https://IP_ADDRESS:2222/ and thus the cert doesn't work. So, either I change my Server's Hostname to the IP address, or I do a redirect to the hostname in directadmin.conf (ssl_redirect_host=server.example.com).

Seems like the default should work, so what am I doing wrong?
 
Hello,

Here is what my /var/www/html/redirect.php has:
PHP:
<?
header("Location: http://".$_SERVER['HTTP_HOST'].":2222");
?>

and yours? Also you might want to

Code:
wget -O /dev/null -d  www.example.com/config 2>&1 | grep Location:

in order to see all redirection path.
 
my /var/www/html/redirect.php is the same as yours, so what do you use as your server's hostname? You IP or your domain?

Or did you edit your redirect in directadmin.conf?
 
I don't use IP as hostnames and I've got defined ssl_redirect_host= in directadmin.conf.
 
Back
Top