Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to configure my apache server with django. I am having issues matching urls to their views and am not quite sure of the cause of the problem. I have the following configuration:


AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ cyber.fcgi/ [QSA,L]

from django.conf.urls import patterns, include, url
from django.conf import settings
from views import index, test
from os import path
urlpatterns = patterns('',
    (r'^$', index),
    (r'^test/$', test),

The problem I am encountering is that all urls that do not start with /cyber.fcgi/ automatically match the index view. For testing, I am printing the url that view sees:           <= matches index with url /test/            <= matches index with url /tes/    <= matches index with url /cyasdasd/12/     <= matches index with url /cyber.fcgi/ <= matches test with url /cyber.fcgi/test/  <= no match

It appears that the correct behavior only occurs when /cyber.fcgi is called directly. I am assuming this is a problem with RewriteRule ^(.*)$ cyber.fcgi/ [QSA,L] but I am not entirely sure nor do I know how to fix it. Any help would be appreciated.

share|improve this question
up vote 2 down vote accepted
RewriteRule ^(.*)$ cyber.fcgi/$1 [QSA,L]

Missing $1 at the end.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.