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

Looking to move XF site from subdomain to root...

Discussion in 'Server Configuration and Hosting' started by Alien, Oct 1, 2013.

  1. Alien

    Alien Well-Known Member

    I'm going to be moving an XF site from a subdomain (forums.sitename.com which is /forums off root dir) to simply sitename.com root under no sub. It was formally a vB 4.x site, so the vb4 redir scripts are still assisting.

    What are my best steps forward?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Very simple, as the FAQ explains.

    How can I move my installation to a different directory?
    Update the Board URL in the ACP -> Options -> Basic Board Information and move the files to the new directory (or rename the directory). You may need to restart the server for the change to take effect.
    Note that redirection will be required to ensure any existing links continue to work.

    Alien likes this.
  3. Alien

    Alien Well-Known Member

    This is what confuses me a bit.

    So I keep the vb4 redir scripts in the new root dir with the rest of my xf files, but is there something special I need to do with .htaccess to assist Googlebot at all?
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Well the problem you will have now is indexed content from your original vB installation and now your XenForo installation so you will need two lots of redirects, assuming you don't want any dead links.

    One for vB to the new XenForo URLs and one for the old XenForo URLs to the new XenForo URLs.
    Both should be simple enough to set up.

    This for example is the redirect I have in .htaccess after moving my installation from /community to the root.
    RewriteRule ^community$ / [R=301,L]
    Alien likes this.
  5. Alien

    Alien Well-Known Member

    So if I use the added "L", would that code need to be added then to the bottom of the htaccess file?
  6. Brogan

    Brogan XenForo Moderator Staff Member

    As per the FAQ:

    Alien likes this.
  7. Alien

    Alien Well-Known Member

    OK, I was used to seeing the "L" added after the perm 301 redirect usually at the bottom in other instances to help prevent loops and such. I thought it prevented apache from processing further rules. After some research it appears it is more used to just close a "block" of rules.

    So mine would be:

    RewriteRule ^forums$ / [R=301,L]

    Lastly, it would appear that Google doesn't even have any of our pages with *showthread* in them (we used to use full friendly urls a few years ago). Kind of tempting to ditch the additional vb4 redir files, though I suppose they still do help with internal linked pages (and are friendlier than just getting an error and forcing a person to search). Probably best to keep 'em.
  8. Brogan

    Brogan XenForo Moderator Staff Member

    It's entirely possible that Google has reindexed now but as you say, the redirects may still be required for links in posts on your own and other sites.
    Alien likes this.
  9. Alien

    Alien Well-Known Member

    Yeah, going through the listings for the site shows showthread.php only in a small handful of sites that aren't even search engines. I do have internal stuff though, so it doesn't hurt anything and I'll keep 'em!

    Thank you so much (as always) for your timely patience and support, Brogan!

    This should go pretty smoothly (famous last words). (y)
    Brogan likes this.
  10. Brogan

    Brogan XenForo Moderator Staff Member

    Good luck and welcome to the (root) club :D
    Alien likes this.

Share This Page