I can't understand why this isn't working. The regular expressions seem to work OK in an interactive Python session. Details are below. Grateful thanks for any help.
My web site (still in development) has two applications. The welcome app will handle the marketing side, with links to demos, 'what we do' pages, blogs, etc. Another app, called operations, will host paid applications for business users. A url like mysite.com or www.mysite.com should go to the welcome app. A url with a subdomain, like yourcompany.mysite.com should go to the operations app. This set of routes almost works. For example, localhost:8000 goes to welcome. 'dc.localhost:8000/operations' goes to operations. But 'dc.localhost:8000' gives me http://dc.localhost:8000/.*://localhost.* which goes to the welcome page. In routes: ## this first route should trap "dc.localhost:8000 ## it does not ## I seem to remember the router stops at the first match ('.*://(?P<any>[a-z][A-Z]+)\.localhost', '\g<any>operations' ), ## this route traps "dc.localhost:8000/operations...." ('.*://(?P<any>[a-z][A-Z]+)\.localhost(?P<anything>.*)', '\g<any>operations\g<anything>' ), ## this route traps localhost:8000 ('.*://localhost.*', '/welcome/default/index'), # works ############################################################### Out routes ## not working, as above ('(?P<any>[a-z][A-Z]+)operations', '.*://\g<any>localhost/operations', ), ## works ('(?P<any>[a-z][A-Z]+)operations(?P<anything>.*)', '.*://\g<any>localhost\g<anything>', ), ## works ('/welcome/default/index', '.*://localhost.*', ),

