D6 and subdirectory installs

eliza411's picture

Back in the 4.7 days, I recall that installing drupal in a subdirectory could cause major headaches with some of the contrib modules and was in general kind of a pain. Has anyone worked with drupal in a subdirectory in D6 recently? If so, I'd really appreciate hearing about your experience.

Login to post comments

The Drupal Camp PDX site was

jhedstrom's picture
jhedstrom - Wed, 2009-11-04 00:44

The Drupal Camp PDX site was running in a sub directory. In terms of modules, it's pretty much a non-issue in 6. However, it can still blow up in content if the directory gets renamed (eg, hard-coded links to /foobar/sites/default/files/, or hard-coded links to nodes, etc, will not be automatically updated).


Use Drupal path functions to always find your files

tylerwalts's picture
tylerwalts - Wed, 2009-11-04 01:31

If you run into cases where you have those previously mentioned hard-coded links, replace them with one of the drupal functions to get paths. For example:

  • Instead of '/foobar/sites/default/files/', use file_directory_path() 
  • Instead of '/foobar/sites/all/modules/custom_modules/my_module_name/', use drupal_get_path('module', 'my_module_name'); 
  • Instead of '/foobar/sites/all/themes/zen/my_theme_name/', use drupal_get_path('theme', 'my_theme_name'); 
  • Tyler

I was talking about those

jhedstrom's picture
jhedstrom - Wed, 2009-11-04 01:43

I was talking about those paths in content, and it's not really practical to tell people they need to write every node in php so they can use those functions ;)


Dev-Specific

tylerwalts's picture
tylerwalts - Wed, 2009-11-04 05:52

Good point, my comment above is more applicable when developing a theme or module that references a file somewhere.

  • Tyler

No serious issues in either 5 or 6

bonobo's picture
bonobo - Wed, 2009-11-04 05:13

This has not been a major issue for us for the last couple years.

Cheers,

Bill

FunnyMonkey
Click. Connect. Learn.
Using Drupal in Education


The only module that I am

nonsie's picture
nonsie - Wed, 2009-11-04 23:19

The only module that I am aware of that cannot be in a subdirectory install is Domain Access


Issues with FCKEditor

Campsoupster - Thu, 2009-11-05 16:37

I had an issue a few months back with FCKEditor's handling of relative URLs on a site located in a subdomain. You'd like that setting the base URL correctly in the settings.php file would solve this, but I actually had to change the base URL in the .htaccess file. Not really sure why. But it worked. ;)


No problems that I've seen

David D's picture
David D - Sat, 2009-11-07 00:51

I have several sites with Drupal 6 in a subdirectory with no problems.

The only issue I've run into was with a multisite installation hosted at hotdrupal.com. All my secondary sites were working just fine there (mostly different domains, not subdomains), but when I finally got the Drupal version of the primary domain on my account ready to go (converting from my old static site), it would not work. I tried all sorts of things with no success. When I finally called Hot Drupal, Steve's solution was to move the Drupal installation up one level to the root public_html folder. Then everything was finally copacetic. But I speculate that it may have been as much an issue with the particulars of how Hot Drupal had things configured (because of their special handling of the primary domain on the account) as it was anything inherent to Drupal. But that's the only multisite installation I have going, so no "control group".