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.
精彩评论