Redirection from Apache Default Page to Checkmk Login Page

Hi there,

I’m facing a problem. In my organisation we are using checkmk.
We get on checkmk when we go following domain: example/example

But when we are looking just for the part before the slash, only example (which could be ip or smth else), we get the apache2 default page.

I was looking on the internet before for a solution, but couldn’t find anything.
Is there a way to redirect the apache default page to the checkmk login page?

Thank you in advance.

Quick and dirty, add this to the index.html (Apache default site) in the root folder.

<script>
window.location.replace("http://myserver/mysite");
</script>

Then, when you are tinkering with mod_rewrite and mod_redirect, be sure to match the terminating $ (end of string) to avoid loops, like this mod_redirect only solution:

RedirectMatch 301 ^/$ http://myserver/mysite/
RedirectMatch 301 ^$  http://myserver/mysite/

Thank you!

I’ve just deleted the whole default index.html file, created a new one with just a basic html code and in the header i’ve put your script.
I ignored the part with RedirectMatch.

It’s working when you only just change the content from the index.html file.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.