从django和wsgi的子目录服务wordpress博客 [英] Serve wordpress blog from subdirectory with django and wsgi

查看:264
本文介绍了从django和wsgi的子目录服务wordpress博客的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用dreamhost进行共享托管计划,并根据 http://wiki.dreamhost安装Django .com / Django 。但是,我也有一个wordpress博客,我希望继续运行在一个子目录,即site.com/blog。

I'm currently on shared hosting plan with dreamhost and have installed Django as per http://wiki.dreamhost.com/Django . However, I also have a wordpress blog that I wish to keep running in a subdirectory, i.e, site.com/blog.

是否可以这样做。安装Django会导致Django根目录中的一个passenger_wsgi.py文件,将所有请求重定向到django

Is it possible to do this. Installing Django results in a passenger_wsgi.py file in the Django root directory which redirects all the requests to django

如果我尝试去我的博客我收到一个错误,因为显然它不在url.py中。是否可以通过配置wsgi或django以某种方式提供wordpress博客,我该怎么做?

if i try to go to my blog i get an error since obviously it's not in url.py. Is it possible to somehow serve the wordpress blog as is by configuring wsgi or django, and how can i do this?

感谢您的时间

PS我目前已经重命名为passenger_wsgi.py,以便博客显示

P.S. I currently have renamed passenger_wsgi.py so that the blog shows

推荐答案

您可以使用Passenger应用程序中的特定位置禁用Phusion Passenger以下代码:

You can disable Phusion Passenger for specific locations in the Passenger app using the following code:

<VirtualHost *:80>
    ServerName www.foo.com
    DocumentRoot /apps/foo/public
    <Directory /apps/foo/public/wordpress>
        PassengerEnabled off
        AllowOverride all      # <-- Makes Wordpress's .htaccess file work.
    </Directory>
</VirtualHost>

有关更多技巧,请查看Phusion Passenger 文档

For more tricks, check out the Phusion Passenger documentation

这篇关于从django和wsgi的子目录服务wordpress博客的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆