开发者

How to create an exception folder in a django site?

There are a few folders where I house my django site that I want to be rendered as it would on any other non-django site. Namely, forum (vbulletin) and cpanel. I currently run the site with fastcgi. My .htaccess looks like this:

AddHandler application/x-httpd-php5 .htm
AddHandler application/x-httpd-php5 .html
AddHandler fastcgi-script .fcgi
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
AddHandler application/x-httpd-php5 .htm

RewriteCond %{REQUEST_URI} !(mysite.fcgi)
R开发者_StackOverflow中文版ewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]

What are lines I can add so www.mysite.com/forum can not be picked up by django url and be rendered as it would do normally. Thanks.


in your apache vhost conf :

Alias /forum /home/django/project/forum

But i think its better to put your php stuff not inside your django project


You can do

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(mysite.fcgi) [OR]
RewriteCond %{REQUEST_URI} ^forum
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]

This will ensure that the mysite.fcgi rule is triggered only if the url doesn't begin with forum.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜