2 Replies Latest reply: Jul 25, 2007 11:36 AM by Austin Sloat
Austin Sloat Level 2 (195 points)
I originally posted this in the webserver area, but maybe this is a more appropriate place for it....

I have been running one Drupal based site for 6 months or so off of a folder adjacent to the default web document root. A week or so ago I migrated our main web page, which lives in the default location, to Drupal as well. I just put the drupal files into the web root folder, leaving the /webmail, /weblog, and /webobjects folder in place. I have clean urls enabled.

So, squirrelmail continues to work as before but the built-in blojsom installation is having issues. I can still get to the initial page (../weblog), but if I try to go to a blog, ie (../weblog/username) Drupal captures that request and gives a page not found error.

Any ideas on what to try to resolve this? I know that drupal has it's own blogging system, but we use blojsom for an internal blog and the integration with tiger server's directory server is helpful. Thanks.

PowerBook G4 1.67, Mac OS X (10.4.9)
  • Austin Sloat Level 2 (195 points)
    okay, I figured this out. The issue is with the .htaccess file that drupal uses and probably only figures in when having clean urls enabled.

    So, the basic rewrite in .htaccess is

    # Rewrite current-style URLs of the form 'index.php?q=x'.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    This tests whether the requested filename (your url) is a real (f)ile or (d)irectory and by virtue of the "!" condition it does not apply the rewrite rule if there is a valid file or directory requested.

    The blojsom folder is a real location (/weblog) so the rewrite rule doesn't apply and the url is reachable. The url (/weblog/username) is not an actual path in the directory structure but is generated by blojsom so the rewrite rule was being applied.

    To get around this add the following directive before the rewrite rule

    RewriteCond %{REQUEST_URI} !weblog/*

    This checks the requesting url and doesn't apply any rewrite rules to any urls that start with weblog from the base url.
  • Austin Sloat Level 2 (195 points)
    An additional followup for posterity - in addition to the weblog rewrite you will also need a rule for another dynamically generated path so you will get styles, images, etc.

    ReWriteCond %{REQUEST_URI} !blojsom_resources/*

    Message was edited by: Austin Sloat