View Full Version : Document Roots
jderoo
08-14-2010, 01:48 AM
I have a site with Drupal. Drupal is installed in a directory below the document root: /big/dom/xexample/www/drupal/... But this makes the URL http://example.com/drupal/... I would like the URL to simply be http://example.com
I have tried a few things:
I put an index.php in the document root that redirects to the drupal subdirectory. This gets the visitors to the right place, but the actual URL they see in their browser is still in the drupal subdirectory
I tried moving the www directory so I could create a new www symlink that poins to the drupal directory. This didn't work as the system would not let me mv www foo. This is similar to the method I use on a different project on a different ISP.
I feel I must be missing something basic here.
Thanks,
JD
I suspect you could use mod_rewrite to achieve the "hidden" subdirectory but I think that's unnecessary complexity now and later - I don't see the point.
I tried moving the www directory so I could create a new www symlink that poins to the drupal directory. This didn't work as the system would not let me mv www foo. This is similar to the method I use on a different project on a different ISP.I haven't tested this, but I suspect there is a permission issue / safeguard which prevents you from moving the existing www.
Why not simply go to the drupal directory and mv * ../
(or even highlight the files and directories in an (s)ftp program and drag them up one.)
The /www directory is protected from renaming, moving or deleting.
I would suspect that most folks that use Drupal for their main site simply install it to their /www directory and not to a subdirectory.
-Bob
jderoo
08-14-2010, 03:39 PM
Bob, Jeff,
Thank you for the answers. The reason I don't wish to just install Drupal at the top level of the document root is for managing version upgrades. Drupal has semi-frequent minor version upgrades, and there is a new major version that is in beta testing now. What I typically do is have a version of Drupal unpacked in a directory with its version indicated. I then create a symlink to that directory from a directory simply named drupal. When a new version is released, I unpack that version in its own directory tree, copy the relevant files from the old to the new tree, then change the one drupal link to point to the new tree. If for some reason the upgrade goes bad, I revert the symlink and the database image. This way I have the old version readily available. And because we haven't hit our storage limit, I usually just leave the old version in place until I do the next upgrade, Just In Case. I have scripted the copying part of it and do the rest manually (following a checklist), and I realize I could just expand my script to move all of the files into the www area directly, but I like that the method I currently use is self-documenting and is easy to revert and extend. Still, I'll probably just expand the script and move all the files around.
Thanks,
JD
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.