diff --git a/VERSION b/VERSION index 3a3bb142..efea121c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.8 (2012-09-11 14:06:40) stable +Version 2.0.8 (2012-09-11 16:49:24) stable diff --git a/routes.example.py b/routes.example.py index ea7a8142..e65f19ad 100644 --- a/routes.example.py +++ b/routes.example.py @@ -31,16 +31,41 @@ routes_app = ((r'/(?Pwelcome|admin|app)\b.*', r'\g'), # routes_in=( (r'/static/(?P[\w./-]+)', r'/init/static/\g') ) # -routes_in = ((r'.*:/favicon.ico', r'/examples/static/favicon.ico'), - (r'.*:/robots.txt', r'/examples/static/robots.txt'), - ((r'.*http://otherdomain.com.* (?P.*)', r'/app/ctr\g'))) +BASE = '' # optonal prefix for incoming URLs + +routes_in = ( + # do not reroute admin unless you want to disable it + (BASE+'/admin/?$anything','/admin/$anything'), + # do not reroute appadmin unless you want to disable it + (BASE+'/$app/appadmin/?$anything','/$app/appadmin/$anything'), + # do not reroute static files + (BASE+'/$app/static/?$anything','/$app/static/$anything'), + # reroute favicon and robots, use exable for lack of better choice + ('/favicon.ico', '/examples/static/favicon.ico'), + ('/robots.txt', '/examples/static/robots.txt'), + # do other stuff + ((r'.*http://otherdomain.com.* (?P.*)', r'/app/ctr\g')), + # remove the BASE prefix + (BASE+'/$anything','/$anything'), + ) # routes_out, like routes_in translates URL paths created with the web2py URL() # function in the same manner that route_in translates inbound URL paths. # -routes_out = ((r'.*http://otherdomain.com.* /app/ctr(?P.*)', r'\g'), - (r'/app(?P.*)', r'\g')) +routes_out = ( + # do not reroute admin unless you want to disable it + ('/admin/$anything', BASE+'/admin/?$anything'), + # do not reroute appadmin unless you want to disable it + ('/$app/appadmin/$anything',BASE+'/$app/appadmin/?$anything'), + # do not reroute static files + ('/$app/static/$anything', BASE+'/$app/static/?$anything'), + # do other stuff + (r'.*http://otherdomain.com.* /app/ctr(?P.*)', r'\g'), + (r'/app(?P.*)', r'\g'), + # restore the BASE prefix + ('/$anything',BASE+'/$anything'), +) # Specify log level for rewrite's debug logging # Possible values: debug, info, warning, error, critical (loglevels),