The drop is always movingYou know that saying about standing on the shoulders of giants? Drupal is standing on a huge pile of midgetsAll content management systems suck, Drupal just happens to suck less.Popular open source software is more secure than unpopular open source software, because insecure software becomes unpopular fast. [That doesn't happen for proprietary software.]Drupal makes sandwiches happen.There is a module for that

Making a new site appear within the old

Submitted by nk on Sun, 2011-09-25 03:40

I have created a version 2.0 site and the owner wanted the two to live on, keeping the existing v1 pages read-only because the migration costs couldn't be justified. The new site should appear in the same domain -- no subdomains. Yes, even this can be done with Drupal 7 without hacking core with a little help from Apache.

So, we have an old site called and we have We will make it so that homepage shows the homepage and then any other page from appears under for eg. . The solution is to use the proxying feature of Apache -- we could use ProxyPass but using mod_rewrite gives us more control.

Add to the Apache vhost config for

RewriteEngine On
# Homepage
RewriteCond %{HTTP_HOST} ^
RewriteRule ^/$ [P,L]
# Don't duplicate the v2 homepage.
RewriteCond %{HTTP_HOST} ^
RewriteRule ^/v2/?$ [R=301,L]
# Everything else
RewriteCond %{HTTP_HOST} ^
RewriteRule ^/v2/(.*)$$1 [P,L]
# Make the old home page available still under v1/home.
# is just CNAME and ServerAlias to
RewriteCond %{HTTP_HOST} ^
RewriteRule ^/v1/home$ [P,L]


RewriteEngine On
# If accessed directly, redirect.
RewriteRule ^/(.+)$$1 [R=301,L]
# If access directly, redirect the homepage.
RewriteRule ^/$ [R=301,L]

Add to the settings.php:

$base_url = '';
$cookie_domain = '';
$conf['reverse_proxy'] = TRUE;

Add this to a module:

function example_url_outbound_alter(&$path, &$options) {
  if (!
$path || $path == '<front>') {
$options['external'] = TRUE;
$path = $GLOBALS['base_root'];

Commenting on this Story is closed.

Submitted by Anonymous on Sun, 2011-09-25 15:32.

In many cases there even no /v2/ folder is necessary. Apache can serve both index.php and *.html pages simultaneously if set up suitably.

If the "old pages" contain a local link e.g. as a "old version menu entry" pointing back to "home" to connect it to e.g., which is often the case for navigation, the old pages can coexist with a standard Drupal installation. They simply are displayed as static pages as ever, only "new" drupal pages are visible to the drupal processing. I did this twice on D6, and expect no problems with D7 for this.

Obviously that is not the same task as in the post: There are some conditions to the old content, and with some effort it is even possible keep the old startpage in place and stil gain from Drupal functionality for all new content. It stil is a bit more difficult to preserve old folder hierarchies with this method, but it can be done.

I see this as a way to quickly use Drupal and gain time to care later for the old content - either stil keep it static, drop it finally (caring for a info-message, please!), or even use simple URL-aliases to gradually replace old/legacy content one after the other by real drupal pages under the old URL.


Submitted by Anonymous on Mon, 2011-10-03 08:50.

Where does content lookup validation happen? ie, check whether exist then serve, and if doesn't exist proceed to lookup in v1.