Hi Guys,
Sorry to bother you but I am having an issue with configuring a web application which I usully use Apache with and I wondered if someone could point the issue out to me.
The name of the software is PHPIPAM and can be obtained from here http://phpipam.net/documents/download-phpipam/
It uses a .htaccess file file to setup some rewrite rules and one of them is the RewriteBase rule.
After adding the rewrite rules into the OLS Admin Panel that it seems to ignore them (at least the RewriteBase rule anyway).
I have since tried to create a static context with the below rewrite code which should work but alais it seems to not be doing anything and yes its enabled.
Heres the snipet from the vhost config file of OLS, as you can see I moved the RewriteBase to the section in the portel and rest of the code below, which AFAIK should work. Any ideas?
Can anyone give me a hint on what I am doing wrong? Thank you.
Sorry to bother you but I am having an issue with configuring a web application which I usully use Apache with and I wondered if someone could point the issue out to me.
The name of the software is PHPIPAM and can be obtained from here http://phpipam.net/documents/download-phpipam/
It uses a .htaccess file file to setup some rewrite rules and one of them is the RewriteBase rule.
After adding the rewrite rules into the OLS Admin Panel that it seems to ignore them (at least the RewriteBase rule anyway).
I have since tried to create a static context with the below rewrite code which should work but alais it seems to not be doing anything and yes its enabled.
Code:
RewriteEngine on
# change rewrite base if not in root
RewriteBase /ipam
# passthroughs
RewriteRule ^api/.$ - [L]
RewriteRule ^index.php$ - [L]
RewriteRule ^(css|js|site|test)/.*$ - [L]
RewriteRule site/login/captcha/captchashow.php - [L]
# redirect errors
ErrorDocument 400 /error/400/
ErrorDocument 401 /error/401/
ErrorDocument 403 /error/403/
ErrorDocument 404 /error/404/
ErrorDocument 500 /error/500/
# IE login dashboard fix
RewriteRule ^login/dashboard/$ dashboard/ [R]
RewriteRule ^logout/dashboard/$ dashboard/ [R]
# search override
RewriteRule ^tools/search/(.*)/(.*)/(.*)/(.*)/(.*)$ index.php?page=tools§ion=search&addresses=$1&subnets=$2&vlans=$3&vrf=$4&ip=$5 [L]
# Rewrites
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/$ index.php?page=$1§ion=$2&subnetId=$3&sPage=$4&ipaddrid=$5 [L]
RewriteRule ^(.*)/(.*)/(.*)/(.*)/$ index.php?page=$1§ion=$2&subnetId=$3&sPage=$4 [L]
RewriteRule ^(.*)/(.*)/(.*)/$ index.php?page=$1§ion=$2&subnetId=$3 [L]
RewriteRule ^(.*)/(.*)/$ index.php?page=$1§ion=$2 [L]
RewriteRule ^(.*)/$ index.php?page=$1 [L]
Code:
context /ipam/ {
type NULL
location /ipam/
allowBrowse 1
rewrite {
enable 1
base /ipam/
rules <<<END_rules
RewriteEngine on
# passthroughs
RewriteRule ^api/.$ - [L]
RewriteRule ^index.php$ - [L]
RewriteRule ^(css|js|site|test)/.*$ - [L]
RewriteRule site/login/captcha/captchashow.php - [L]
# redirect errors
ErrorDocument 400 /error/400/
ErrorDocument 401 /error/401/
ErrorDocument 403 /error/403/
ErrorDocument 404 /error/404/
ErrorDocument 500 /error/500/
# IE login dashboard fix
RewriteRule ^login/dashboard/$ dashboard/ [R]
RewriteRule ^logout/dashboard/$ dashboard/ [R]
# search override
RewriteRule ^tools/search/(.*)/(.*)/(.*)/(.*)/(.*)$ index.php?page=tools§ion=search&addresses=$1&subnets=$2&vlans=$3&vrf=$4&ip=$5 [L]
# Rewrites
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/$ index.php?page=$1§ion=$2&subnetId=$3&sPage=$4&ipaddrid=$5 [L]
RewriteRule ^(.*)/(.*)/(.*)/(.*)/$ index.php?page=$1§ion=$2&subnetId=$3&sPage=$4 [L]
RewriteRule ^(.*)/(.*)/(.*)/$ index.php?page=$1§ion=$2&subnetId=$3 [L]
RewriteRule ^(.*)/(.*)/$ index.php?page=$1§ion=$2 [L]
RewriteRule ^(.*)/$ index.php?page=$1 [L]
END_rules
}
addDefaultCharset off
}
Last edited: