Note: There now is a Version 2 of the Reverse Proxy module available for Drupal 6. You should use it for new Drupal installs.
Previously, configuring Drupal to work in the Leland web environment with a Virtual Host Proxy (aka, "Vanity URL") required making changes to includes/bootstrap.inc. However, this presented several problems:
- You should not modify Drupal core
- It complicates upgrading
- You should not modify Drupal core
The Stanford Open Source Lab is pleased to present the Reverse Proxy module for Drupal 5 and Drupal 6, now available for beta testing. Please read the README.txt, included with the module and highlighted below, before installing. Bug reports and feature requests can be filed in the comments section of this post.
Two things to be aware of:- Only enable the Reverse Proxy module if the site is using a Virtual Host Proxy. If the module is enabled on a site that is not using a Virtual Host Proxy, it will cause problems.
- Special steps need to be taken when updating Drupal core for a site using a Virtual Host Proxy and the Reverse Proxy module, because normally one disables all contributed modules in the process of updating Drupal core but the problems Reverse Proxy module fixes return when it is disabled, which messes up the update. Either of these two approaches should help you avoid problems:
- Easier but diverging from update instructions: Disable all contributed modules except Reverse Proxy at that stage in the update process
- Allows following update instructions exactly: Before updating, temporarily comment out your base url in settings.php. Use the long form of the url until after the update is complete. After the update, un-comment the base url in settings.php.
README.txt
SUMMARY
This module provides URL rewrites for integrating Drupal with a Reverse Proxy service. It was developed by the Stanford University Open Source Lab for integrating with the Virtual Host Proxy Service provided by Stanford University ITS.
REQUIREMENTS
The below instructions assume that you have /afs/ir/group/groupname/cgi-bin/drupal as your Drupal installation directory.
- Set up a virtual host proxy (http://yourgroup.stanford.edu) to point to your drupal directory:
https://www.stanford.edu/group/yourgroup/cgi-bin/drupal
-
$base_url = 'http://yourgroup.stanford.edu'; // NO trailing slash!
-
RewriteEngine on
RewriteRule (.*) http://yourgroup.stanford.edu/$1 [R=301,L]