开发者

Properly install Wordpress inside Rails without 404s?

I have a Rails site, and I would like to install Wordpress inside the /public direct开发者_StackOverflow社区ory.

I did this, and it works fine, except when I click on an article, it 404s. See http://aromapersona.com/blog/.

How do I keep it from 404ing? I'm assuming I have to add a route.

I'm using Apache and Passenger.


What ended up working was this in a .htaccess file:

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /blog/ 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /blog/index.php [L] 
</IfModule> 


You can disable Passenger in your VirtualHost for a particular location for example

<Location /your/railsfolder/path/public/blog>
    PassengerEnabled off
</Location>

You may want to do something about the Directory directives as well inside. :)


I don't think you have to do anything specifically with the Rails routes. I have a Rails 2.3.8 app setup that works just like this, and there is nothing specific in the Rails app itself.

I am assuming the wordpress blog is sitting in public/blog.

You should be able to add PassengerEnabled Off inside the public/blog/.htaccess.

You'll also want to check your Wordpress settings and make sure that the Wordpress address and Blog address urls are both pointing to http://aromapersona.com/blog

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜