<IfModule mod_rewrite.c>
RewriteEngine On
###############
# ROUTER #
###############
# get router by router_id (api/rest/router/router_id)
RewriteRule ^router/([0-9]+)/?$ api.php?rquest=router&router_id=$1 [QSA,L]
# get router by mac (api/rest/router/mac)
RewriteRule ^router/([a-fA-F0-9]{12})/?$ api.php?rquest=router&mac=$1 [QSA,L]
# get router by hostname (api/rest/router/hostname)
RewriteRule ^router/(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*)/?$ api.php?rquest=router&hostname=$1 [QSA,L]
################
# ROUTERLIST #
################
# routerlist containig all routers (api/rest/routerlist)
RewriteRule ^routerlist/?$ api.php?rquest=routerlist [QSA,L]
#routerlist containing all routers of a special user (api/rest/user/user_id/routerlist)
RewriteRule ^user/([0-9]+)/routerlist/?$ api.php?rquest=routerlist&user_id=$1 [QSA,L]
####################
# NETWORKINTERFACE #
####################
# api/rest/networkinterfacelist/networkinterface_id
RewriteRule ^networkinterface/([0-9]+)/?$ api.php?rquest=networkinterface&id=$1 [QSA,L]
########################
# NETWORKINTERFACELIST #
########################
# networkinterfacelist containig all networkinterfaces (api/rest/networkinterfacelist)
RewriteRule ^networkinterfacelist/?$ api.php?rquest=networkinterfacelist [QSA,L]
# networkinterfacelist containig all networkinterfaces of a special router (api/rest/router_id/networkinterfacelist)
RewriteRule ^router/([0-9]+)/networkinterfacelist/?$ api.php?rquest=networkinterfacelist&router_id=$1 [QSA,L]
###########
# IP #
###########
# api/rest/ip/ip_id
RewriteRule ^ip/([0-9]+)/?$ api.php?rquest=ip&id=$1 [QSA,L]
###########
# IPLIST #
###########
# iplist containing all ip adresses (api/rest/iplist)
RewriteRule ^iplist/?$ api.php?rquest=iplist [QSA,L]
# iplist containing all ip adresses of a special networkinterface (api/rest/networkinterface/networkinterface_id/iplist)
RewriteRule ^networkinterface/([0-9]+)/iplist/?$ api.php?rquest=iplist&interface_id=$1 [QSA,L]
# iplist containing all ip adresses of a special network (api/rest/network/network_id/iplist)
RewriteRule ^network/([0-9]+)/iplist/?$ api.php?rquest=iplist&network_id=$1 [QSA,L]
###########
# NETWORK #
###########
# api/rest/network/network_id
RewriteRule ^network/([0-9]+)/?$ api.php?rquest=network&network_id=$1 [QSA,L]
################
# NETWORKLIST #
################
# networklist containing all networks (api/rest/networklist)
RewriteRule ^networklist/?$ api.php?rquest=networklist [QSA,L]
#############
# DNS-ZONE #
#############
# api/rest/dns_zone/dns_zone_id
RewriteRule ^dns_zone/([0-9]+)/?$ api.php?rquest=dns_zone&id=$1 [QSA,L]
##################
# DNS-ZONE-LIST #
##################
# dns zone list containing all dns-zones (api/rest/dns_zone_list)
RewriteRule ^dns_zone_list/?$ api.php?rquest=dns_zone_list [QSA,L]
# dns zone list containing all dns-zones of a special user (api/rest/user/user_id/dns_zone_list)
RewriteRule ^user/([0-9]+)/dns_zone_list/?$ api.php?rquest=dns_zone_list&user_id=$1 [QSA,L]
########################
# DNS-RESSOURCE-RECORD #
########################
# api/rest/dns_ressource_record/dns_ressource_record_id
RewriteRule ^dns_ressource_record/([0-9]+)/?$ api.php?rquest=dns_ressource_record&id=$1 [QSA,L]
#############################
# DNS-RESSOURCE-RECORD-LIST #
#############################
# dns ressource record list containing all ressource record (api/rest/dns_ressource_record_list/)
RewriteRule ^dns_ressource_record_list/?$ api.php?rquest=dns_ressource_record_list [QSA,L]
# dns ressource record list containing all ressource records of a special dns_zone (api/rest/dns_zone/dns_zone_id/dns_ressource_record_list/)
RewriteRule ^dns_zone/([0-9]+)/dns_ressource_record_list/?$ api.php?rquest=dns_ressource_record_list&dns_zone_id=$1 [QSA,L]
# dns ressource record list containing all ressource records of a special user (api/rest/user/user_id/dns_ressource_record_list/)
RewriteRule ^user/([0-9]+)/dns_ressource_record_list/?$ api.php?rquest=dns_ressource_record_list&user_id=$1 [QSA,L]
##########################
# ORIGINATOR-STATUS-LIST #
##########################
# originator status list containing all batman advanced originators (api/rest/originator_status_list/)
RewriteRule ^originator_status_list/?$ api.php?rquest=originator_status_list [QSA,L]
# originator status list containing all batman advanced originators of a special router (api/rest/router/router_id/originator_status_list/)
RewriteRule ^router/([0-9]+)/originator_status_list/?$ api.php?rquest=originator_status_list&router_id=$1 [QSA,L]
##############
# EVENT #
##############
# api/rest/event/event_id
RewriteRule ^event/([0-9]+)/?$ api.php?rquest=event&id=$1 [QSA,L]
RewriteRule ^event/?$ api.php?rquest=event [QSA,L]
##############
# EVENTLIST #
##############
# eventlist containing all events known to netmon (api/rest/eventlist)
RewriteRule ^eventlist/?$ api.php?rquest=eventlist [QSA,L]
# eventlist containing all events of a special router (api/rest/router/router_id/eventlist)
RewriteRule ^router/([0-9]+)/eventlist/?$ api.php?rquest=eventlist&router_id=$1 [QSA,L]
###########
# CONFIG #
###########
# config by id (api/rest/config/config_id)
RewriteRule ^config/([0-9]+)/?$ api.php?rquest=config&id=$1 [QSA,L]
# config by name (api/rest/config/name)
RewriteRule ^config/([0-9A-Za-z_-]+)/?$ api.php?rquest=config&name=$1 [QSA,L]
###############
# CONFIGLIST #
###############
# configlist containing all configs known to netmon (api/rest/configlist/)
RewriteRule ^configlist/?$ api.php?rquest=configlist [QSA,L]
################
# CRAWL-CYCLE #
################
# crawl_cycle by id (api/rest/config/crawl_cycle)
#RewriteRule ^crawl_cycle/([0-9]+)/?$ api.php?rquest=crawl_cycle&id=$1 [QSA,L]
#####################
# CRAWL-CYCLE-LIST #
#####################
# crawl_cycle_list containing all crawl_cycles known to netmon (api/rest/crawl_cycle_list/)
RewriteRule ^crawl_cycle_list/?$ api.php?rquest=crawl_cycle_list [QSA,L]
</IfModule>