开发者

How to serve PHP together with Django?

开发者 https://www.devze.com 2023-01-05 05:59 出处:网络
i have a Bluehost hosting account, and i manually configure django with this tutorial, but now i need to run php scripts into a subdomain or in subfolder, how can i do that? my root .htaccess look lik

i have a Bluehost hosting account, and i manually configure django with this tutorial, but now i need to run php scripts into a subdomain or in subfolder, how can i do that? my root .htaccess look like this

AddHandler fcgid-script .fcgi
# For security reasons, Option followsymlin开发者_Python百科ks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(django\.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ django.fcgi/$1 [L]

Thanks!


It would actually be easier to serve from a subdomain, configured in its own VirtualHost block.


I got it, just change a little htaccess and ready, stay this way for those who have the same problem:

AddHandler fcgid-script .fcgi
AddHandler application/x-httpd-php5s .php
# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /
RewriteRule ^(subfolder/.*)$ - [L]
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(django\.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ django.fcgi/$1 [L]

Thanks!

0

精彩评论

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