I am trying to set up a Wordpress blog at mysite.com/blog :(already established WP blog, not moving it to Drupal too much change involved and we find WP easier to blog with, whereas Drupal best for the site itself)

I've followed the advice on here:
http://drupal.org/node/877828
(Modified the .htaccess file to use these rules:

  RewriteCond %{REQUEST_URI} !^blog
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

and used an original Drupal .htaccess file INSIDE the /blog folder)

BUT I keep getting 404 errors on the /blog site itself (blog root) and when visiting any other url e.g. /blog/my-first-post it takes me to a page which looks look its from the drupal site.

I'd like to know - has anyone managed to get this working?

We really are desperate to get this working properly as it would be such a nice elegant solution and great for SEO to have the
blog at /blog (instead of on a subdomain, see http://www.seomistry.com/2011/03/02/subdomains-vs-subdirectories-what-is...)

I'm not sure how I can debug this either - any ideas would be appreciated!

gvanto

Comments

kennedyabitbol’s picture

Modified the .htaccess file to use these rules:

  RewriteCond %{REQUEST_URI} !^blog
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
<strong>and used an original Drupal .htaccess file INSIDE the /blog folder</strong>)

Hi,
you should let the drupal htaccess in the root folder with the escape /blog rules and use the wordpress htaccess in the blog folder.

gvanto’s picture

Hey, thanks for the help - but I forgot to mention that I've already tried this - still getting 404 error.

So the Drupal site lives at:
/home/myu5er/public_html/dev72/
And the blog WP files at:
/home/myu5er/public_html/dev72/blog/

The WP (/blog) .htaccess looks as follows:

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

I've modified the above (just did a redirect) to see if it came into effect, and it does. Wondering if the RewriteBase / has something to do with this maybe?

Trying to check apache access.log entries now ...

kennedyabitbol’s picture

Have you tryed
RewriteBase /blog/?

gvanto’s picture

it seems that was the trick!

Installed a brand new WP from here and got the .htaccess as such (suggested by permalinks section in wp-admin):

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

Note that I couldn't get an existingn blog (at blog.pethostr.com ) pointed to it - it seems there's a lot of db config that determines paths and things ... so best to install fresh on /blog and just stick to that (ie dont include /blog in the deployment cycle).

Thumbs up for SEO!