2010-04-26 41 views
2

我想在我的rails应用程序中运行一个wordpress实例。我目前在public/wordpress中有wordpress文件,但我需要配置我的.htaccess文件以允许这两种类型的请求。我怎么做?目前,的.htaccess是:如何编辑.htaccess以允许rails和wordpress请求?

一般的Apache选项
AddHandler的fcgid脚本.fcgi
RewriteEngine叙述在
重写规则^ $的index.html [QSA]
重写规则^([^。] +)/ $! $ 1.HTML [QSA]
的RewriteCond%{} REQUEST_FILENAME!-f
重写规则^(。*)$ dispatch.fcgi [QSA,L]
的ErrorDocument 500 “应用程序错误应用程序无法正常启动”

回答

3

你应该st艺术加入到公用文件夹中的.htaccess:

RewriteCond %{REQUEST_URI} ^/wordpress.* 
RewriteRule .* - [L] 

但是,这不是整个故事。您还需要编辑/ etc/apache2的/网站可用/ 这个除此(告诉Rails不处理在/博客的任何作为应用程序的一部分):

<Location /wordpress> 
PassengerEnabled off 

而且在/ etc/apache2的/ apache2.conf你可能需要告诉Apache使任何目录索引(如wordpress /)执行一个index.php文件(如果有的话):

DirectoryIndex index.php