Best practices for running Wordpress on the same domain as Rails app
What's the best way to run Wordpress on the same domain as a Rails application? I've got a standard Rails app with Nginx and Mongrel running at http _ mydomain. I need to run a Wordpress blog at http _ mydomain _ com _ blog. My preference would be to host the blog in Apache running on either the same server or a separate box but I don't want the user to see a different server in the URL. Is that possible and if not, what would you recommend to accomplish the goal? 5 Answers Actually, since you're using Nginx, you're already in great shape and don't need Apache. You can run PHP through fastcgi (there are examples of how to do this in the Nginx wiki), and use a URL-matching pattern in your Nginx configuration to direct some URLs to Rails and others to PHP. Here's an example Nginx configuration for running a WordPress blog through PHP fastcgi (note I've also put in the Nginx equivalent of the WordPress .htaccess, so you will also have fancy URLs alre...
Read more…
Using Apache mod_rewrite to remove sub-directories from URL
Using Apache mod_rewrite to remove sub-directories from URL I'm managing an instance of Wordpress where the URLs are in the following format: /example-category/blog-post-permalink/ The blog author did an inconsistent job of adding categories to posts, so while some of them had legitimate categories in their URLS, at least half are "uncategorised". I can easily change Wordpress to render the URL without the category name (e.g., /blog-post-permalink/), but I'd like to create a mod_rewrite rule to automatically redirect any requests for the previous format to the new, cleaner one. How can I use a mod_rewrite recipe to handle this, taking into account that I want to honor requests for the real WordPress directories that are in my webroot? 1 Answer Something as simple as: RewriteRule ^/[^/]+/([^/]+)/?$ /$2 [R] Perhaps would do it? That simple redirects /foo/bar/ to /bar That seems to work great with my testing so far. Thanks for the help! Joomla Blog/Wordpre...
Read more…