Problem with routing

27 views
Skip to first unread message

elyase

unread,
Dec 25, 2012, 10:58:02 AM12/25/12
to web...@googlegroups.com
I have two controllers 'default.py' and 'error.py'. In my website www.cubadena.com, if I try to access www.cubadena.com/default it correctly redirects to the index() function inside the default controller, but if I do the same with www.cubadena.com/error/ I get a: 

Not Found

The requested URL /error/ was not found on this server.

Looking at the server logs I see a "Attempt to serve directory: /var/www/error/" error. How is this possible? I have both controller files inside the web2py controller folder, and corresponding index.html files inside a 'default' and 'error' folders in the application views folder. Another curious thing is that if I add the application name to the URL it works as expected for example: www.cubadena.com/cubadena/error (works!!)

This is how my web2py routes.py looks like:

routers = dict(
    BASE=dict(default_application='cubadena'),
    cubadena=dict(languages=['en', 'es'], default_language='es'),
)

routes_onerror = [(r'*/*', r'/cubadena/error/index')]

What can I do to correct this behaviour?

Jonathan Lundell

unread,
Dec 25, 2012, 11:49:57 AM12/25/12
to web...@googlegroups.com
This looks more like a server configuration problem than a routing problem. For some reason your server isn't sending the /error request to web2py at all, but rather trying to serve it from the file system.
Reply all
Reply to author
Forward
0 new messages