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

XF 1.3 Redirects after moving xenforo from directory to root

Discussion in 'Installation, Upgrade, and Import Support' started by Mr Lucky, Jun 16, 2014.

  1. Mr Lucky

    Mr Lucky Well-Known Member

    I am thinking of moving my xenforo installation from a subdirectory into the root.

    Currently the root has redirect scripts from my prvious vbulletin installation, and I think this is straightforward to change in the 301config.php

    Or do I just remove the 301config.php altogether and keep showthread.php etc.


    I also want to redirect from the previous xenforo so that want was e.g. domain.com/community/forums goes to domain.com/forums

    My concern here is getting a redirect that doesn't conflict with the vbulletin redirects.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add these rules to the top of the .htaccess file in your /community directory:

    RewriteEngine On
    RewriteRule ^(.*)$ /$1 [R=301,L]
    The vB redirect scripts should be fine remaining in the web root.
    Mr Lucky likes this.
  3. Mr Lucky

    Mr Lucky Well-Known Member

    Thanks Jake, that worked.

    Amazing, I searched Google on redirecting directory to root, tried the first 6 and none of them worked.

    What a nice forum this is.

    Also I had to remember to comment out the path to the directory in 301config.php of course.
  4. Pygmalion2008

    Pygmalion2008 Member

    I do not have a /community directory. My problem is this: I had Wordpress with a bridge in my root directory. I recently decided to go with 8WayRun's Xenporta2, and I copied my forums directory contents into the root (in my case, the XF forums directory is /gforums. I wanted to delete the /gforums directory and change the Board Information URL to my site URL. That did not work, even though I could easily access my Admin panel. As of now, I have both the root and the /gforums directory because without the /gforums directory the forums do not show and my users get 500 INTERNAL SERVER ERROR. How do I add the rewrite and have only the ONE directory?
    Last edited: Aug 30, 2015
  5. AndyB

    AndyB Well-Known Member

    What do you have entered here:

    Admin CP -> Options -> Basic Board Information -> Index Page Route
    Pygmalion2008 likes this.
  6. Pygmalion2008

    Pygmalion2008 Member

    Right now, it says /articles because I want Xenporta2's articles page to show first (and it does). The site is GateFans Forums and when you click the Forums link, it goes to GateFans Forums, even though there is no /forums directory. The original XF install is in gforums, but a copy of the contents of /gforums is in the root now as well. Naturally, that is causing issues. If one goes to a thread in the root and uploads a file, it ends up in the /data/attachments folder instead of /gforums/data/attachments. Stuff like that. Thumbnail generation has gone wonky as well.
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Remove the /gforums directory. Then add these rules to the top of the .htaccess file in your web root directory:

    RewriteEngine On
    RewriteRule ^gforums/(.*)$ /$1 [R=301,L]
    Pygmalion2008 likes this.
  8. Pygmalion2008

    Pygmalion2008 Member

    This did not work for me. The board kept returning to the Articles page for Xenporta2 and I could not access the forums. Restoring the /gforums directory fixed it. I am having issues with thumbnail generation too. Only when I upload things in the /gforums directory will the thumbnails generate.
  9. Pygmalion2008

    Pygmalion2008 Member

    WORKING NOW! Thank you very much, Jake!
  10. Ancoreig

    Ancoreig Member

    Hi Mr Lucky, I have planned to move my XF to the root as you did. My question is, did you just move XF through the FTP just by drag-and-drop or did you do something special about it?
  11. Mr Lucky

    Mr Lucky Well-Known Member

    That's exactly what I did.
    Ancoreig likes this.

Share This Page