Hello!
I have a drupal installation in my domain root, with wordpress running under the /blog subdirectory. This was all fine and well until I tried using the drupal blog module, which tries to use that same /blog subdirectory, only to get the request lost in the wordpress scripts.
The specifics:
- I have my wordpress URL's set up to use the year as the first part of the path past blog, for example: http://www.example.com/blog/2010/this-is-a-blog-post
- Drupals blog module will use the same spot for the year, but populate it with userid data, example for user 1: http://www.example.com/blog/1
- My goal is to have all URLs with a number in that 3rd URL part route back to http://www.example.com/index.php so Drupal can bootstrap it
- The exceptions being the numbers 2010-2020 (those users are just out of luck) - I want those reserved for the next 10 years worth of wordpress blogging.
The solution is to hack up the .htaccess file in my wordpress directory.
Here is my ham-handed attempt at doing so:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
# Here I try to route any URL with numbers after /blog/
RewriteRule ^\d+ http://www.example.com/index.php [L]
# Here I try to send 2010-2020 back to /blog/index.php
RewriteRule ^(201\d | 2020)/* http://www.example.com/blog/index.php [L]
</IfModule>
# END WordPress
I feel like I'm not doing this quite right, and want to be sure before I put this on a live server. Can anyone verify and help point me towards fixing any broken parts?
Thanks so much!
-Ryan