# Rails/Wordpress/Apache/Passenger - not working with custom permalinks

**URL:** <https://www.ruby-forum.com/t/rails-wordpress-apache-passenger-not-working-with-custom-permalinks/159778>\
**Category:** Rails\
**Created:** [February 8, 2009, 6:04pm UTC](https://www.ruby-forum.com/t/rails-wordpress-apache-passenger-not-working-with-custom-permalinks/159778 "2009-02-08T18:04:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rzolkos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@rzolkos](https://www.ruby-forum.com/u/rzolkos)\
**Post date:** [February 8, 2009, 6:04pm UTC](https://www.ruby-forum.com/t/rails-wordpress-apache-passenger-not-working-with-custom-permalinks/159778/1 "2009-02-08T18:04:30Z")

</div>

Hi,

I’m trying to get an installation of wordpress working in a blog  
directory under /public in a rails app. The webserver is Apache using  
phusion passenger.

I’ve tried following the instructions in this blog post  
[http://www.igvita.com/2007/07/04/integrating-wordpress-and-rails/](http://www.igvita.com/2007/07/04/integrating-wordpress-and-rails/)

Everything works fine if I just use the normal Wordpress permalink  
structure. However, once I customise the permalinks none of the  
patterns seem to be being matched in my .htaccess and the request  
passes to the rails router where it of course fails.

This is in my .htaccess

RewriteBase /blog/  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteCond %{REQUEST\_FILENAME} !-d  
RewriteCond %{REQUEST\_FILENAME} ^/blog/\d+.\*  
RewriteRule . /blog/index.php [L]  
RewriteRule ^/blog$ /blog/index.php [QSA]  
RewriteRule ^(/blog._/$)$ $1/index.php [QSA]  
RewriteRule ^/blog/?(._)$ %{DOCUMENT\_ROOT}/blog/$1 [NC,QSA,L]

Hopefully someone on this list can help.

Thanks,  
r
