Mobile app version of vmapp.org
Login or Join
Phylliss660

: How do I map some subdirectories to run alongside a Drupal site? I have a Drupal site running on Apache using the following vhosts file: <VirtualHost xx.xx.xx.xx:80> ServerName

@Phylliss660

Posted in: #Apache #Virtualhost

I have a Drupal site running on Apache using the following vhosts file:

<VirtualHost xx.xx.xx.xx:80>
ServerName bananas.net
ServerAlias bananas.net DocumentRoot /var/www/drupal/
RewriteEngine On
RewriteCond %{HTTP_HOST} !=bananas.net [NC]
RewriteRule ^(.*)$ bananas.net [L,R=301]

<Directory /var/www/bananas.net/>
Options -Indexes FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>


I set it up some time ago, so I am not sure what the <Directory /var/www/bananas.net/> directive was meant for. That directory is currently empty.


With the vhosts file the way it is, does the Directory directive have any effect at all?
I want to add some content which is separate from the Drupal site. How do I add sub-directories within /var/www/bananas.net/ which can be accessed alongside the Drupal site running at the root? As they have nothing to do with the Drupal site, I want to keep the files separate, but still using the same domain.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gail5422790

If you are trying to get sub directories outside of the document root to appear as a part of the document root, you should use mod_alias:

Alias /subdirectory /path/to/real/subdirectory

So if you had the sub-directory 'peel' that you wanted to show up as 'http://www.bananas.net/peel' without putting it inside '/var/www/drupal', you would do:

Alias /peel /var/www/bananas.net/peel

You can do this either in the vhost file or, if you allow overrides in /var/www/drupal, using a .htaccess file.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme