Forum

rewrite rules translation help for zoneminder api

Erik S
23 April 2017, 19:34
Hello Hugo, I wonder if you could please help me translate these re-write rules into toolkits. I am struggling to get the ZoneMinder API to work. The API functions are the last hurdle in an error free running ZoneMinder CCTV system using Hiawatha instead of Apache. These are the rules in 2 .htaccess files:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
RewriteBase /zm/api
</IfModule>


<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
RewriteBase /zm/api
</IfModule>


any help will be greatly appreciated. I am hoping to solve the API rewrite problems for zoneminder running under Hiawatha!
Hugo Leisink
24 April 2017, 16:48
UrlToolkit {
ToolkitID = first_rule
Match ^/(.*) Rewrite /webroot/$1
}

UrlToolkit {
ToolkitID = second_rule
Match ^/(.*) Rewrite /app/webroot/$1
}

I have no idea what RewriteBase does. Probably you have to place /zm/api in front of the URL after Rewrite.
Erik S
25 April 2017, 15:46
As usual I tip my hat for the great support! Thank you Hugo for the help. Once I can get the API functions working, I plan to add a How To install and configure ZoneMinder with Hiawatha, MySQL, PHP5 and PERL to the documentation and Wiki for zoneminder on Ubuntu based distros in particular Puppy Linux Tahr 6.0.5 and Tahr 6.0.6 (Ubuntu 14.04 binaries). ZoneMinder runs extremely well with Hiawatha otherwise.
This topic has been closed.