用django和apacheconfigurationhtaccess

我正在尝试用djangoconfiguration我的apache服务器。 我遇到的问题与他们的观点匹配的url,我不太清楚问题的原因。 我有以下configuration:

.htaccess

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

urls.py:

 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), ) 

我遇到的问题是,所有不以/cyber.fcgi/开头的URL自动匹配索引视图。 为了testing,我正在打印视图所看到的url:

 www.example.com/test/ <= matches index with url /test/ www.example.com/test <= matches index with url /tes/ www.example.com/cyasdasd/123 <= matches index with url /cyasdasd/12/ www.example.com/cyber.fcgi/ <= matches index with url /cyber.fcgi/ www.example.com/cyber.fcgi/test <= matches test with url /cyber.fcgi/test/ www.example.com/cyber.fcgi/asd <= no match 

看起来只有直接调用/cyber.fcgi时才会出现正确的行为。 我假设这是RewriteRule ^(.*)$ cyber.fcgi/ [QSA,L]但我不完全确定,也不知道如何解决它。 任何帮助,将不胜感激。

 RewriteRule ^(.*)$ cyber.fcgi/$1 [QSA,L] 

最后缺less$ 1。