File pnp4nagios-httpd.conf of Package pnp4nagios

#
# example apache config for PNP4nagios
#

<IfDefine PNP4NAGIOS>
 Alias /pnp  /usr/share/pnp4nagios
 Alias /pnp4nagios /usr/share/pnp4nagios
 <Directory /usr/share/pnp4nagios>
    Options None
    AllowOverride None
 <IfModule mod_authz_core.c>
    Require all granted
 </IfModule>
 <IfModule !mod_authz_core.c>
    Order allow,deny
    Allow from all
 </IfModule>
	# 
	# Use the same value as defined in nagios.conf
	#
    AuthName "PNP4Nagios Access"
    AuthType Basic
    AuthUserFile  /etc/nagios/htpasswd.users
    #    AuthGroupFile /etc/nagios/htpasswd.group
    #    Require group nagios    
    Require valid-user
    # sad to say, but currently necessary:
    #php_admin_flag safe_mode off

    <IfModule mod_rewrite.c>
        # Turn on URL rewriting
        RewriteEngine On
        Options symLinksIfOwnerMatch
        # Installation directory
        RewriteBase /pnp4nagios/
        # Protect application and system files from being viewed
		RewriteRule "^(?:application|modules|system)/" - [F]
        # Allow any files or directories that exist to be displayed directly
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        # Rewrite all other URLs to index.php/URL
		RewriteRule "^.*$" "index.php/$0" [PT]
    </IfModule>
 </Directory>
</IfDefine>