In order to keep all the Drupal files together, I wanted to install it into the ~pageroot/drupal/ subdirectory of my web server, but I didn’t want to have to access it via http://www.mysite.com/drupal/ — I wanted to access it as if it lived in the root, at http://www.mysite.com/.
Here’s my solution:
In the root, I placed an .htaccess file that contained:
Options -Indexes
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC]
RewriteRule .* http://www.mysite.com/ [L,R=301]
RewriteRule ^$ drupal/index.php [L]
RewriteCond %{DOCUMENT_ROOT}/drupal%{REQUEST_URI} -f
RewriteRule .* drupal/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* drupal/index.php?q=$0 [QSA]
Then in drupal/.htaccess, I disabled the mod_rewrite instructions by changing “<IfModule mod_rewrite.c>” to
<IfModule XXXmod_rewrite.c>
Finally, in drupal/sites/default/settings.php, I uncommented the line
$base_url = 'http://www.mysite.com';
Not sure if there might be a better solution, but this seems to work fine.