I have a huge Drupal 6 site, and a small, newer partial version of the site on Drupal 8. Instead of migrating, we decided to build a brand new site from scratch.

Is it possible to host the site such that:

http://www.sitename.com takes user to --> new D8 site

http://www.sitename.com/topic1 /topic2 takes user to new site.

http://www.sitename.com/topic3 /topic4 (everything else) takes user to old D6 site?


  • I hope you are aware that D6 is no longer supported; therefore, D6 will never ever get any security updates from drupal.org. So /topic4 (everything else) will potentially be vulnerable to getting hacked. – No Sssweat May 16 '17 at 23:31
  • Yes, and we're rapidly moving to D8. But it's a huge site, and there's a lot of custom modules to move so, unfortunately, we do have to keep it for now. – softwareseattle May 16 '17 at 23:39
  • What webserver are you running? nginx, apache? – David Thomas May 17 '17 at 0:25
  • We're running Apache. – softwareseattle May 18 '17 at 20:15

You can use a reverse proxy for this, both Apache and Nginx support this. What you do is that you make the Drupal 6 site available on a different URL. This might be even a local url, like sitename2.local. Add this to the hosts file on your server (/etc/hosts on Linux) and point it to Make sure you set up a virtual host in your webserver to point sitename2.local to the root directory of your Drupal 6 site.

By using a reverse proxy you tell your webservice to forward calls to /topic/4 to sitename2.local/topic/4 and return it to the user, just like a proxy. In Nginx it should look something like:

location /topic/4 {
    proxy_pass http://sitename2.local/topic/4;

For Apache you need to enable the proxy modules:

> a2enmod
> proxy proxy_ajp proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html

Your virtual host file should look something like this:

<VirtualHost *:*>
    ProxyPreserveHost On

    ProxyPass /topic/4 http://sitename2.local/topic/4
    ProxyPassReverse /topic/4 http://sitename2.local/topic/4

If you Google around for reverse proxy you will find tons of information on how to exactly configure them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.