In Drupal 6, I was able to successfully install Drupal in the drupal subdirectory, and then link to the site without using example.com/drupal. In Drupal 6, to make this work, I did the following: - Created a .htaccess file in the root directory where / drupal was created. File contents:
Options -Indexes RewriteEngine On RewriteRule ^$ drupal/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ drupal/$1
The drupal/sites/default/settings.php file has been drupal/sites/default/settings.php , for which $ base_url is defined as: $base_url = 'http://example.com';
When I try to do the same for Drupal 7, only the first page can be displayed, all pages fail pretty badly (or only appear on the first page). I also tried to uncomment the RewriteBase lines in /drupal/.htaccess. First I tried RewriteBase /drupal , and then I tried RewriteBase / . But both attempts failed. I never had to do this with D6, but I thought I would eliminate this possible solution.
I am currently testing a new installation of Drupal 7 using xampp (version 1.7.4) with example.com under htdocs (i.e. xampp / htdocs / example.com / drupal). The Drupal 6 site is in the same xampp installation, but of course with a different directory path (e.g. xampp / htdocs / d6example.com / drupal). Please note that I also have Drupal 6 installed on the production server with the modified value of the $ base_url variable.
So, how can you install Drupal 7 in a subdirectory and then run it from this directory without the directory name in the url? Note. I install Drupal 7 in a subdirectory, as it makes it easier to upgrade between new versions of the Drupal 7 kernel.
spots source share