1 Reply Latest reply: Jun 7, 2007 12:03 AM by Austin Sloat
Austin Sloat Level 2 Level 2
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. So does phpmyadmin, which is in its own folder in the web root. I don't use webobjects so I don't know about that, 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 Level 2
    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.