Drupal is a registered trademark of Dries Buytaert
Drupal 11.4.3 Update released for Drupal core (11.4.3)! Views Bulk Operations (VBO) 4.4.6 Minor update available for module views_bulk_operations (4.4.6). External Authentication 2.0.12 Minor update available for module externalauth (2.0.12). No Request New Password 8.x-1.6 Minor update available for module noreqnewpass (8.x-1.6). Entityqueue 8.x-1.12 Minor update available for module entityqueue (8.x-1.12). Burndown 1.0.67 Minor update available for module burndown (1.0.67). User Email Preview 1.0.2 Minor update available for module user_email_preview (1.0.2). Static Suite 1.2.7 Minor update available for module static_suite (1.2.7). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs. ActiveTickets Client 1.0.1 Module activetickets_client updated after 9 months of inactivity (1.0.1).

Virtual Base is designed to address a specific use case: enabling an existing Drupal website to be accessed via additional URLs that include a specified path prefix. This functionality provides a virtual "RewriteBase" layered on top of the website.

For instance, consider a scenario where your website is typically accessed internally (without any RewriteBase) within a private organization. Simultaneously, it is also accessible through an external gateway that uses a fixed URL, with the Drupal website available under a specific path prefix.

Features

Similar to the way path prefixes are used for languages, configuring a path prefix "XXX" in the Virtual Base module allows a route such as "/node/1" to also be accessible at the URL "/XXX/node/1".

Post-Installation

One you install the module, you need to configure the path prefix.
You can use the admin form available at '/admin/config/system/virtual-base'.

You need to add instructions to your .htaccess file to make this module work properly.

Inside the .htaccess file of Drupal, add the following lines, to cope with the path prefix `my_prefix`

# ---
# Virtual Base configuration
# ---

RewriteRule .* - [E=VIRTUAL_BASE:]

RewriteCond %{REQUEST_URI} ^/my_prefix
RewriteRule .* - [E=VIRTUAL_BASE:/my_prefix]

RewriteCond %{REQUEST_URI} ^/my_prefix
RewriteRule ^my_prefix/(.*)$ /$1 [L]

# cope with apache env variable rewritings when having urls redirects
RewriteCond %{ENV:REDIRECT_VIRTUAL_BASE} (.+)
RewriteRule .* - [E=VIRTUAL_BASE:%1]

If you want to enable the module for a specific domain,
you can add a line `RewriteCond %{HTTP_HOST} ^specific\.domain_name\.com`
and replace `specific\.domain_name\.com` with the domain name you want to restrict the module to.

# ---
# Virtual Base configuration
# ---

RewriteRule .* - [E=VIRTUAL_BASE:]

RewriteCond %{HTTP_HOST} ^specific\.domain_name\.com
RewriteCond %{REQUEST_URI} ^/my_prefix
RewriteRule .* - [E=VIRTUAL_BASE:/my_prefix]

RewriteCond %{HTTP_HOST} ^specific\.domain_name\.com
RewriteCond %{REQUEST_URI} ^/my_prefix
RewriteRule ^my_prefix/(.*)$ /$1 [L]

# cope with apache env variable rewritings when having urls redirects
RewriteCond %{ENV:REDIRECT_VIRTUAL_BASE} (.+)
RewriteRule .* - [E=VIRTUAL_BASE:%1]

Activity

Total releases
1
First release
Jul 2026
Latest release
2 hours ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
1.0.0-alpha5 Pre-release Jul 15, 2026