more examples in routes.example.py
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.0.8 (2012-09-11 14:06:40) stable
|
Version 2.0.8 (2012-09-11 16:49:24) stable
|
||||||
|
|||||||
+30
-5
@@ -31,16 +31,41 @@ routes_app = ((r'/(?P<app>welcome|admin|app)\b.*', r'\g<app>'),
|
|||||||
# routes_in=( (r'/static/(?P<file>[\w./-]+)', r'/init/static/\g<file>') )
|
# routes_in=( (r'/static/(?P<file>[\w./-]+)', r'/init/static/\g<file>') )
|
||||||
#
|
#
|
||||||
|
|
||||||
routes_in = ((r'.*:/favicon.ico', r'/examples/static/favicon.ico'),
|
BASE = '' # optonal prefix for incoming URLs
|
||||||
(r'.*:/robots.txt', r'/examples/static/robots.txt'),
|
|
||||||
((r'.*http://otherdomain.com.* (?P<any>.*)', r'/app/ctr\g<any>')))
|
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<any>.*)', r'/app/ctr\g<any>')),
|
||||||
|
# remove the BASE prefix
|
||||||
|
(BASE+'/$anything','/$anything'),
|
||||||
|
)
|
||||||
|
|
||||||
# routes_out, like routes_in translates URL paths created with the web2py URL()
|
# 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.
|
# function in the same manner that route_in translates inbound URL paths.
|
||||||
#
|
#
|
||||||
|
|
||||||
routes_out = ((r'.*http://otherdomain.com.* /app/ctr(?P<any>.*)', r'\g<any>'),
|
routes_out = (
|
||||||
(r'/app(?P<any>.*)', r'\g<any>'))
|
# 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<any>.*)', r'\g<any>'),
|
||||||
|
(r'/app(?P<any>.*)', r'\g<any>'),
|
||||||
|
# restore the BASE prefix
|
||||||
|
('/$anything',BASE+'/$anything'),
|
||||||
|
)
|
||||||
|
|
||||||
# Specify log level for rewrite's debug logging
|
# Specify log level for rewrite's debug logging
|
||||||
# Possible values: debug, info, warning, error, critical (loglevels),
|
# Possible values: debug, info, warning, error, critical (loglevels),
|
||||||
|
|||||||
Reference in New Issue
Block a user