Tired of crappy webhosts?

Running Drupal And Wordpress On The Same Web Server

Drupal logo
So you got a wonderful Drupal site running on your web server and have put in a lot of sweat creating and administrating it. But you have a desire to venture out and try to do some work with Wordpress. Here's some tips to get this to work.

HTTP Errors Everywhere

If you try to install and run separate Drupal and Wordpress websites on the same webserver, you will run into problems and likely see HTTP 404 and HTTP 500 errors blasting all over the place.

Having burned time trying to get this to work, I came up with the following solution that will hopefully help someone out there.

Setting Up Wordpress

We want to install Wordpress in it's own folder so we can organize our files better.

Imagine if you want to install some web software that is different than Wordpress. You don't want to install this in the Wordpress folder because that would be silly.

So you would setup a file structure like so:

/
  /wordpress-site.com
    /wp
    /myapp
    /myotherapp

Download and unzip Wordpress from Wordpress.org.

Assuming you have already have an existing Drupal site setup in the root directory of your web server, create a wp directory and copy the files so it looks something like this:

/
  /includes (drupal)
  /misc (drupal)
  /modules (drupal)
  /profiles (drupal)
  /scripts (drupal)
  /sites (drupal)
  /themes (drupal)
  .htaccess
    .
    .
    etc.
  /wordpress-site.com
    /wp
      /wp-admin
      /wp-content
      /wp-includes
      include.php
      license.txt
      .
      .
      xmlrpc.php

WordPress .htaccess

Copy the code below to your text editor and save it as .htaccess.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L,QSA]
</IfModule>

Move it to the root of your Wordpress website:

/
  /includes  (drupal)
  /misc  (drupal)
  /modules  (drupal)
  /profiles (drupal)
  /scripts (drupal)
  /sites (drupal)
  /themes (drupal)
  .htaccess (drupal)
    .
    .
    etc.
  /wordpress-site.com
    .htaccess
    /wp
      /wp-admin
      /wp-content
      /wp-includes
      include.php
      license.txt
      .
      .
      xmlrpc.php

Modify Wordpress URL Settings

Go to your Wordpress administration console and change the following:

Summary

Making these changes will allow you to run Drupal and Wordpress on the same webserver.

Filed under: