On Jun 20, 8:09 am, toasterfun <[EMAIL PROTECTED]> wrote: > Hello, I'm having an issue with the url tuple at the top of the > application: > > urls = ( > '/index/(.*)', 'indexpage' > ) > > What is the (.*) for? Because my index page doesn't really need any > dynamic content, I wish I could just do: > > '/index/', 'indexpage' > > But I get an error:http://img209.imageshack.us/my.php?image=errorqh7.png > > What do I do? > > Also, how do I add other URLs? I want to add an about page, so my > immediate instinct is to do this: > > urls = ( > '/index/(.*)', 'indexpage', > '/about/', 'aboutpage' > ) > > but that doesn't work. What do I do? > > And one last question. Right now, I'm accessing my script by going > tohttp://localhost/test.wsgi/. How do I get rid of the filename so I can > do this:http://localhost/index > and in the future...http://example.org/indexhttp://example.org/about
The mod_wsgi documentation which I believe I have already pointed you to explains the latter, specifically, in section 'The Apache Alias Directive' of: http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines it gives the example: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /site.wsgi/$1 [QSA,PT,L] This works better than the example in web.py documentation as any static files in directory will take precedence without you needing to enumerate them in the rewrite rule. So, search for that example and read the commentary around it. As to mapping multiple URLs, am sure the web.py documentation would tell you this. An alternate way is to more or less ignore web.py mapping system and use Apache instead. For this you would want to add for that directory: WSGIApplicationGroup mygroup in Apache configuration. This will cause all WSGI script files in same directory to be run in shared Python interpreter instance within processes. Rather than then push everything through one single WSGI script/ application, use multiple WSGI script files as independent entry points, ie., index.wsgi, about.wsgi, etc etc. The .wsgi extension need not be used in URL provided you set up MultiViews for Apache URLs, which is also described in the above document. This approach would definitely be preferable if the URLs are really related to disparate applications and not all connected. Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
