Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1052733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:08:28+00:00 2026-05-16T17:08:28+00:00

So every web.py tutorial I’ve seen includes this line: urls = ( ‘/’, ‘index’,

  • 0

So every web.py tutorial I’ve seen includes this line:

urls = (
    '/', 'index',
)

And then, later on, the index class is defined with a GET function and so on. My problem is, this doesn’t work. Using the code above, I get a 404 error. Using the following mapping works:

urls = (
    '/.*', 'index',
)

But that’s going to catch, at least at first, every single possible URL, and I want only an access to the domain root to be handled by “index.” Halp?

Some basic info:

Python 2.6, web.py 0.3, Apache 2.2 with mod_wsgi

Not sure what else would be useful, so if there is something important I can add (the VirtualHost from Apache, maybe?) please ask and I’ll add it here.

EDIT: Including my Apache VirtualHost config:

<VirtualHost *:80>
    ServerName dd.sp4.us
    DocumentRoot /home/steve/www/nov2010/public/
    ErrorLog /home/steve/www/nov2010/log/error.log
    CustomLog /home/steve/www/nov2010/log/access.log combined

    WSGIScriptAlias / /home/steve/www/nov2010/app
    Alias /static /home/steve/www/nov2010/public

    <Directory /home/steve/www/nov2010/app>
        SetHandler wsgi-script
        Options ExecCGI
    </Directory>

    AddType text/html .py

    <Location />
        RewriteEngine on
        RewriteBase /
        RewriteCond %{REQUEST_URI} !^/static
        RewriteCond %{REQUEST_URI} !^(/.*)+code.py/
        RewriteRule ^(.*)$ code.py/$1 [PT]
    </Location>
</VirtualHost>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:08:28+00:00Added an answer on May 16, 2026 at 5:08 pm

    For background read:

    http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines

    Presuming you only have the one WSGI application to be mounted at root of site and only static files or other resources are under /static, then instead of:

    WSGIScriptAlias / /home/steve/www/nov2010/app
    Alias /static /home/steve/www/nov2010/public
    
    <Directory /home/steve/www/nov2010/app>
        SetHandler wsgi-script
        Options ExecCGI
    </Directory>
    
    AddType text/html .py
    
    <Location />
        RewriteEngine on
        RewriteBase /
        RewriteCond %{REQUEST_URI} !^/static
        RewriteCond %{REQUEST_URI} !^(/.*)+code.py/
        RewriteRule ^(.*)$ code.py/$1 [PT]
    </Location>
    

    use:

    Alias /static /home/steve/www/nov2010/public
    
    WSGIScriptAlias / /home/steve/www/nov2010/app/code.py
    
    <Directory /home/steve/www/nov2010/app>
    Order allow,deny
    Allow from all
    </Directory>
    

    You are mixing up multiple ways of configuring mod_wsgi which shouldn’t be used together.

    If your requirements are something else, you are going to have to be clearer about what you want to happen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i know every web-developer hates this topic, but anyway... i found no good solution
I think I read every single web page relating to this problem but I
Every example I've seen on the web, e.g. http://www.codeproject.com/KB/docview/jms_to_jms_bridge_activem.aspx , creates a publisher and
I am using Facebook C# SDK V6 and am using this tutorial. http://csharpsdk.org/docs/web/getting-started I
I am working on an ASP.NET WebForm application using MVP pattern. For every Web
Every new web service you create using visual studio comes with a predefined namespace
In Apache Wicket web framework every component returns false from getOuputMarkupId() by default .
In an Activity, I need to call a web service every 30 seconds or
In every benchmark that I found on the web it seems that Ruby is
Every time I start working on a new J2EE web application, I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.