I have a question about how Drupal handles requests made to subdirectories of the Drupal root that aren't under Drupal control.

What I mean is lets say I have a Site directory as such:

My main site -- an HTML flat site -- includes -- sites -- ... Other drupal necessary files

My concern is: does Drupal load bootstrap on every server request made to its directory? For example, I go straight to mysite/anhtmlflatsite - does Drupal do any type of loading? Or does it just let the web server serve up the sub directory no Drupal love added?

I ask because right now when accessing these flat sites I'm noticing that some files in my includes directory are getting hit (we have them push messages to the error log so that's how I know they're getting loaded when I access these flat sites). Also whenever the Drupal install breaks so do the paths to these flat HTML nothing to do with Drupal sites as well.

Curiouser and curiouser... Anyone have any insight to what's down the rabbit hole?

Oh and I'm using Drupal 7


The default .htaccess file has these lines in it:

# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]

So Drupal will only attempt to take control of a path if the file or directory doesn't already exist. All requests to your flat HTML site should be served without Drupal getting involved.

Maybe you've got some 404s in your flat HTML site? If they point to a folder underneath the web root that might explain why Drupal is getting hit.

  • I like the answer and thank you.. So the fact that the files in the include directory are getting called could be an artifact of something we added to the .htaccess? Any idea why drupal would start executing scripts from the includes directory? I figured I'd see if I could get a further response if not I'll accept this one in the mean time. :) thank you – Brodie Oct 22 '12 at 23:44
  • Apart from the 404 thing I don't I'm afraid. Don't feel like you need to rush with accepting the answer, leave it open for a bit someone else might have some insights :) – Clive Oct 22 '12 at 23:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.