Fork me on GitHub
Please upgrade to 2.1.x here. The 2.0 branch is no longer being updated.
Critical: Update to 2.1.8, released 15 Jan.

Moving Vanilla from Subdirectory to Subdomain

aeryaery Gtricks Forum in 2.2 :) ✭✭✭
edited March 2012 in Vanilla 2.0 Help

I have vanilla forum as subdirectory along with my blog at

After the recent panda attack and talking to few SEO masters, they advised me to move to subdomain as it will be treated differently by Google and help me recover.

I have some 200 threads and 1000 users on the forum which I would like to move to a subdomain.

Effectively, I want to move from to

Does Vanilla provides this functionality like the wordpress? What should I do. Is simple htaccess modification like shown below enough?

RewriteEngine on
RewriteRule ^forum/(.*)$1 [R=301,NC]

Vanilla is sweet & support is great, to encourage volunteers, please donate.

Best Answers

  • x00x00 MVP
    edited March 2012 Answer ✓

    I would do

    RedirectMatch 301 /forum(/.*)?$1?redirection=1

    then in /dashboard/routes -> Add

    Route Expression
        Permanent (301)

    After this do another one

    Route Expression
        Permanent (301)

    This is for those that are using friendly urls, it will redirect everything, if there is an additional query string it will just redirect to the method and parameters minus the query arguement.

    grep is your friend.

  • edited September 2013 Answer ✓

    Moving a forum from a directory to a sub-domain should be easy, let me try to help. From what I know, there are two ways to move a Vanilla Forum from a sub-directory to a sub-domain.

    Make a backup of your forum first. I don't want you to complain if anything goes wrong. :)

    METHOD-1: The Easy-Peasy way — If it works, it works. So, try this one first.

    [1] First create a sub-domain relative to the vanilla forum installation directory, so that points to This should be very easy of you have Cpanel control panel installed.

    [2] Change the code in the .htaccess file inside your vanilla forum directory to this. Yes, it should be exactly this:

    <IfModule mod_rewrite.c>
       RewriteEngine On
       # Certain hosts may require the following line.
       # If vanilla is in a subfolder then you need to specify it after the /. 
       # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
       # RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]

    Do you see the difference from the existing code in your .htaccess file? It's the 6th line. It should just be / and not /forum because you are actually going to access your forum from a sub-domain, which in a way, works like a domain.

    Now, go to your forum from and login to your dashboard. Do you see Here's how to get started: section? Inside that, you'll see something like this:

    2. Where is your Community Forum? Access your community forum by clicking the "Visit Site" link on the top-left of this page, or by clicking here. The community forum is what all of your users & customers will see when they visit

    If you see there, you can consider that your forum has moved.

    METHOD-2: The hard way, but almost guaranteed to work

    You'll need to make a fresh install of Vanilla Forum on a sub-domain, then import the tables, and static files (images & others) from your existing forum.

    This is meant to be a pointer. I am not explaining this hoping that METHOD-1 will work for you.

    EDIT: You also need to setup 301 redirection from to if you don't want to lose any pagerank or traffic coming from search engine-indexed links.

    I repeat, I am not 100% sure of these methods. I didn't even try these. But when I checked the differences between my two forum installations — one on a sub-domain and another on a sub-directory, the .htaccess files were (almost) the only ones that were different.

    Hope that helps! :)


Sign In or Register to comment.