Control Web Panel

WebPanel => CentOS-WebPanel GUI => Topic started by: Iz3k34l on June 19, 2019, 08:39:26 PM

Title: Default web page
Post by: Iz3k34l on June 19, 2019, 08:39:26 PM
Is there a way to set a default page for the CWP server for example if you go to host.domain.com:2031 you get the login page as you expect but if you go to host.domain.com you get an error with no page. aside from the error i would to maybe redirect elsewhere. how can i do this
Title: Re: Default web page
Post by: evansa on June 19, 2019, 09:10:53 PM
What error do you get?
Title: Re: Default web page
Post by: Iz3k34l on June 19, 2019, 09:29:17 PM
Hmm. We’re having trouble finding that site.

We can’t connect to the server at web1.getitdesigned.us.

If that address is correct, here are three other things you can try:

    Try again later.
    Check your network connection.
    If you are connected but behind a firewall, check that Firefox has permission to access the Web.

Title: Re: Default web page
Post by: evansa on June 20, 2019, 07:47:27 PM
Does pinging web1.getitdesigned.us resolve to your public IP?
Title: Re: Default web page
Post by: Sandeep on June 21, 2019, 08:32:12 AM
you need to add DNS - A record ip for web1.getitdesigned.us
Title: Re: Default web page
Post by: Nazgile on July 01, 2019, 11:19:18 PM
my solution was an .htaccess redict to https://host.domain.tld:2031/  now if any visit host.domain.tld it will auto redict to the login page u can change the port for userlogin too.

in the apache main folder i think /var/apache/htdocs or /usr/apache/htdocs - not sure yet :D

edit:

create .htaccess /usr/local/apache/htdocs with follow text inside:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subhostdomain\.domain\.tld$ [NC]
RewriteRule ^(.*)$ https://subhostdomain.domain.tld:2083/$1 [L,R=301]

for example:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^srv1\.testdomain\.de$ [NC]
RewriteRule ^(.*)$ https://srv1.testdomain.de:2083/$1 [L,R=301]