ssl redirect but different :)

I figured this out. If anyone wants to know I will post it. It is more or less on this forum.
 
Ok here it is.
1. SSH to server and su
2. cd /var/www/html
3. mkdir login
4. cd login
5. nano index.php (You can use VI or Pico as well)
6. Paste the following code into inidex.php:

<?php

header("Location: https://servername:2222");

?>

7. Save file.
8. cd /etc/httpd/conf
9. nano httpd.conf
10. search for the following line:
#Start DirectAdmin Settings

11. Add the following code:
Alias /cpanel /var/www/html/login/

12. save httpd.conf
13. restart apache

It works for me:)
 
Technically you only really need to modify the httpd.conf and add the follwoing since DirectAdmin already has a redirect.php file for /config setup

Code:
Alias /cpanel /var/www/html/redirect.php

It is already setup to redirect /config to the login page.
Code:
Alias /config /var/www/html/redirect.php[/config]
 
Last edited:
I don't see a redirect.php file in that location, but it is on the server. Well it's the same either way and it works :)

Thanks.
 
Back
Top