Ideas on what I can put in place to not show the Nethserver webpage when no port is used

Hello Team,

I have Nethserver installed and used as our Domain Controller and Nextcloud system in our office. If I put in the port to login to Nethserver or add in /Nextcloud to the FQDN I obviously get to the right login page. But if no port or full name is given I see the Nethserver landing page that says I’m running Nethserver.

I see that I can add a page to /var/www/html/ directory. How can I force the login page to go to NexCloud if someone doesn’t put in the correct full website name? So if my website is https://mysite.com:8443/nextcloud and someone puts in https://mysite.com:8443 only they are still redirected to my Nextcloud site?

Thanks.

I think you can do it with a html-redirection. The code of the site you have to safe as /var/www/html/ should look like the following:

<!DOCTYPE HTML>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="0; url=https://mysite.com:8443/nextcloud">
        <script type="text/javascript">
            window.location.href = "https://mysite.com:8443/nextcloud"
        </script>
        <title>Page Redirection</title>
    </head>
    <body>
        <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
        If you are not redirected automatically, follow this <a href='https://mysite.com:8443/nextcloud'>link to https://mysite.com:8443/nextcloud</a>.
    </body>
</html>
4 Likes

Thank you @m.traeumner for your helpful response.

Do I name this file in /var/www/html something like redirect.html? I’m assuming the extension of the file I create here is an .html page.

Does the html service need to be restarted or is it best to have the whole Nethserver restarted?

Thank you.

I think it schould be index.html.

1 Like

Excellent suggestions @m.traeumner. My problem is solved. Much appreciated!

1 Like

You can also use a .htaccess to redirect
See here https://mediatemple.net/community/products/grid/204643080/how-do-i-redirect-my-site-using-a-htaccess-file

2 Likes