Change default landing page
Change default landing page
Hello,
The default URL for nagiosxi is http://ServerName/NagiosXI. Unfortunately, that means that if you just go to http://ServerName that you then have to click on a link to take you to the \NagiosXI page. Is there any way to redirect traffic directly to the /NagiosXI page? I know how to do this with IIS but not with Apache.
Thanks!
The default URL for nagiosxi is http://ServerName/NagiosXI. Unfortunately, that means that if you just go to http://ServerName that you then have to click on a link to take you to the \NagiosXI page. Is there any way to redirect traffic directly to the /NagiosXI page? I know how to do this with IIS but not with Apache.
Thanks!
Re: Change default landing page
This doc will show how to change the landing page:
https://assets.nagios.com/downloads/nag ... g-Page.pdf
https://assets.nagios.com/downloads/nag ... g-Page.pdf
Be sure to check out the Knowledgebase for helpful articles and solutions!
Re: Change default landing page
Thank you for your response, but this is not the information I was looking for. I was trying to make it where people were automatically redirected to the log-in page instead of the "click here to get to the log-in page" page. The document you referenced tells how to change what page shows up after a user logs on. I was referring to before they log on.
Incidentally, I figured it out. You have to edit the following file:
/var/www/html/index.php
Somewhere in there (I put it in the header) stick the following code:
BOOM! No more having to click twice to get to the login page.
This question has been answered. You can close this thread.
Incidentally, I figured it out. You have to edit the following file:
/var/www/html/index.php
Somewhere in there (I put it in the header) stick the following code:
Code: Select all
<?php
header("Location: http://ServerName.YourCompany.com/nagiosxi/");
?>
This question has been answered. You can close this thread.
Re: Change default landing page
This will work, but index.php will be overwritten when you update.
I would rewrite this at an apache level rather then PHP, by doing the following:
Modify /etc/httpd/conf.d/nagiosxi.conf and look for -
Before the </IfModule>, add this -
Then restart httpd, and it will redirect / to /nagiosxi/.
I would rewrite this at an apache level rather then PHP, by doing the following:
Modify /etc/httpd/conf.d/nagiosxi.conf and look for -
Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule nagiosxi/api/v1/(.*)$ /usr/local/nagiosxi/html/api/v1/index.php?request=$1 [QSA,NC,L]
</IfModule>
Code: Select all
RedirectMatch ^/$ /nagiosxi/
Former Nagios Employee
Re: Change default landing page
Home Page Modification in admin manage components seems to be what you're looking for. The http://<nagios fqdn> leads to a page where you click a link to log in. http://<nagios fqdn>/nagiosxi leads to the page defined in components or a login prompt.
Re: Change default landing page
Thanks @gormank!
@SavaSC - let us know if you have any further questions.
@SavaSC - let us know if you have any further questions.
Former Nagios Employee
Re: Change default landing page
gormank wrote:Home Page Modification in admin manage components seems to be what you're looking for. The http://<nagios fqdn> leads to a page where you click a link to log in. http://<nagios fqdn>/nagiosxi leads to the page defined in components or a login prompt.
Unless there is something I'm missing, this doesn't do what I am requesting. This is for after a user logs in, not before.
Re: Change default landing page
This worked! Thank you so much!rkennedy wrote:This will work, but index.php will be overwritten when you update.
I would rewrite this at an apache level rather then PHP, by doing the following:
Modify /etc/httpd/conf.d/nagiosxi.conf and look for -Before the </IfModule>, add this -Code: Select all
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule nagiosxi/api/v1/(.*)$ /usr/local/nagiosxi/html/api/v1/index.php?request=$1 [QSA,NC,L] </IfModule>Code: Select all
RedirectMatch ^/$ /nagiosxi/
Then restart httpd, and it will redirect / to /nagiosxi/.
Re: Change default landing page
Is it alright if we lock this thread and mark the issue as resolved, or did you need additional assistance with the landing page configuration?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Change default landing page
You can lock it. Thank you for the assistance.