1. 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

Discussion in 'XenForo Questions and Support' started by cmeinck, Feb 5, 2014.

  1. cmeinck

    cmeinck 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.

  2. Jake Bunce

    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]
  3. cmeinck

    cmeinck Well-Known Member

Share This Page