I'm trying to integrate a third-party produced, "shiny-object" web site that isn't going to be integrated into Drupal; however, it should show up as a "sub directory" within the main domain. For example, www.example.com/* is a Drupal 7 managed URL/Domain, but I'd like www.example.com/shiny to be served straight through Apache without Drupal taking over. I've seen similar requests here and elsewhere that have what seem like a very simple solution, just add...
DirectoryIndex index.php index.shtml index.html
...to a .htaccess file in the directory you wish to manage. Seems simple enough, but it doesn't appear to work in Drupal 7, perhaps due to changes in the main .htaccess file, perhaps due to some implied additional instructions that I'm unaware of...I'm not well versed with .htaccess, so if I'm taking the instructions at face value, in other words, following the instructions exactly as presented, creating a blank file called .htaccess in textmate and adding the above line to it and saving in the directory (which I assume is in my sites/www.example.com/shiny folder).
Has anyone been able to include content within a Drupal managed URL that isn't managed by Drupal in Drupal 7? If so, can you explain how? To a non-.htaccess squire? Is there a module for that? Does the above solution actually work, if so what am I missing besides all of it? Thanks?
Comments
Try this
Drupal is a 404 handler. If Apache can serve a resource, it will. If there is a file in a directory named foo.jpg or bar.js and you point to it, Apache will happily serve it directly to the requesting browser, and Drupal doesn't even know it's happened.
If you create a directory /test on your server and place an index.php file in it containing the following:
<php phpinfo(); ?>... and visit www.example.com/test, you should see the usual phpinfo display.
Multisite should not be an issue. It merely enables Drupal to locate the most appropriate Drupal configuration for a given Drupal page request. It doesn't kick in unless the basic request fails and Apache asks Drupal to resolve the path.
It's possible that your application is expecting a different PHP configuration than it inherits. For example, it might assume magic_quotes_gpc is turned on, or register_globals (a bad practice). These are explicitly disabled in Drupal's .htaccess file. You could try disabling them in your own .htaccess. Note the relevant section of Drupal's settings:
You also could try forcing mod_rewrite off for your target directory.
Thanks, but not working
@yelvington, thanks for your help but I'm using a stock Drupal 7 .htaccess file. Also, I don't know how to prevent mod_rewrite.
I'm using Drupal 7 multi-site
In apache all root directories point to /var/www/drupal
I could add the folder to my drupal folder, but it would show up on all sites
I'm assuming I can place a folder in my /var/www/sites/www.example.com/ directory.
For instance: /var/www/sites/www.example.com/staticcontent
What I can't figure out is how to keep Drupal from taking over the contents of the staticcontent folder.
Has anyone actually done this and can they provide some insight?
what happens
From both posts I can't understand what IS happening. Are you getting a 404 error? Do you have private files turned on? That would do it.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
404
I'm getting the following:
Page not found
The requested page could not be found.
Private files is not turned on.
Also, I'll add as mentioned above, I'm not even sure where the folder should go. If I put it in the /var/www/drupal folder it works fine, however, ALL sites served by the single code base include the directory. Also, I like to keep my Drupal directory clean for updates. I may be able to use a symlink to keep the directory clean, but then I still have the problem of all sites "seeing" the directory. For example www.example1.com/directory, and www.example2.com/directory, even though I only want it on the one site.
You should be able to do this
You should be able to do this in D6 and D7. Although I have not tried using multi-site on D7. As mentioned, it shouldn't make a difference. Maybe you discovered a bug?
I would be curious if the permissions are getting re-written and when. Are you running any special permissions granting modules? I have seen cases where a permissions module will just spawn a new .htaccess file as soon as a directory is uploaded. Could that be the case?
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
hello, did you manage to sort it?
hello, did you manage to sort it? I have the same needs (but on D6) to store some old pre-drupal migration stuff and I don't want to place it on the main drupal folder but rather on a subfolder of my individual site..
Possible Solution?
I don't know if this will work for your multi-site issue, but have you thought of using a subdomain through your web host in order to handle a separate non-Drupal folder? I just set this up on my own site and it works although you do have to add an .htaccess file as described above. Theoretically you could set up shiny.examplesite1.com and your host will direct to a folder of the same name located in the root of your drupal installation. You wouldn't put the folder in /sites. Since the folder shiny.examplesite2.com doesn't exist, both URLs would not have access to this content.