• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Handling redirects when moving from subdirectory to subdomain


Well-known member
I'm planning on moving one of my forums from a subdirectory /forum/ to forum.mysite.com. I plan on setting up a 301 from /forum/ to the subdomain. When I first started my site, it was a vBulletin site, so I've got the XF redirect scripts, etc. in place. Do I need to make any changes to those or will the 301 be sufficient? I'm trying to minimize any potential issues.


Jake Bunce

XenForo moderator
Staff member
If the old /forum directory is the web root for the new "forum.mysite.com" subdomain then everything (including the redirect scripts) can remain in place. It's just a matter of redirecting the host portion of the URL. To redirect the host portion you need to add these rules to the top of the .htaccess file in the /forum directory (replacing your domain name appropriately):

RewriteEngine On

RewriteCond %{HTTP_HOST} !^forum\.mysite\.com$
RewriteRule ^(.*)$ http://forum.mysite.com/$1 [R=301,L]