Moving Between Content Management Systems (Drupal to Joomla)

Written by James McDonald

August 14, 2015


If you decide that you want to move your business website between content management systems.

You might want to ensure that your old links to specific content are still accessible.

Some examples being blog posts, images or downloads.

Following are two .htaccess hacks to

  1. firstly provide a download link that matches the old location without reproducing the original directory structure and also
  2. redirecting content from one URL to another with a permanent redirect.

Making Download Content Seamlessly Available from the old URL but put the content in another directory

The old server had files stored in /var/www/

and you accessed them using a URL like this

The new server has a web root of /var/www/

And I want to put download files in /var/www/ avoiding the previous CMS’s deep directory structure

So to get your old URLs to work you put some rewrite rules in your .htaccess file in /var/www/

RewriteCond %{REQUEST_URI} "^/sites/default/files/.*$" [NC]
RewriteRule "^sites/default/files/(.+)$"  "downloads/$1" [PT]

The above code will make sure that the client won’t be redirected but the web server will serve the file on the old URL from the new location of the file in the downloads folder

Redirecting Clients and Search Engines to new URL’s

The next .htaccess hack is making sure that your blog posts from the old URL scheme (Drupal) are properly redirected to the new content on the new CMS (Joomla).

Redirect permanent /blog/going-above-and-beyond

# or with RedirectPermanent
RedirectPermanent /blog/going-above-and-beyond

The permanent keyword makes the web server issue a 301 “Moved Permanently” redirect which apparently Google and other search engines take as a sign that the search engine ranking for the old URL /blog/going-above-and-beyond should now apply to the new URL

You can add as many Redirect statements as needed but if you have many hundreds of URLs to remap you may want to look at using RedirectMap or regular expressions to achieve this without making .htaccess too big.


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…