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

XF 1.1 Moving from /forum to directory root

Discussion in 'XenForo Questions and Support' started by DaveL, Nov 6, 2011.

  1. DaveL

    DaveL Well-Known Member

    I upgraded around a month ago from IPB3.1 to Xenforo.

    My forum us currently installed in /forum as that is how it was installed on IPB. I have all the redirects in place so all the old IPB links point to the new Xenforo Links.

    If I wanted to move Xenforo into the root now, what issues is that going to cause me and is there an easy way to get around it?
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. jadmperry

    jadmperry Well-Known Member

    Not to highjack the thread, but I am curious if there is any reason or advantage to putting XF in the root or in /forums? I mean for functional purposes, not style and, I assume that putting it in the root to a degree limits what else you could put in the root (i.e., you could not use the same server to run different installations or different sites from the root, at least without significant issues).
  4. Brogan

    Brogan XenForo Moderator Staff Member

    It's partly personal preference and partly related to what else you plan to install.

    This is from the same FAQ:

    Should I install XenForo in the web root or a directory?
    This is personal preference and depends how you intend to structure your site. If you plan to install additional software in the root such as a CMS or have a home page, then it may make more sense to install the software in a directory.
    Note that you can not have two files with the same name in the same directory, for example index.php.
  5. DaveL

    DaveL Well-Known Member

    Hi Brogan,

    Thanks for the reply.

    My main question is though regarding the re-directs. Will it cause major issues as I only converted from IPB3.1 around a month ago and I have a redirect on for that.

    Is it easily altered so that an IPB link of mydomain.com/forum/topic/350772-this-is-my-thread points to the new root directory thread?

    Hope that makes sense!
  6. DaveL

    DaveL Well-Known Member

    My main reason is because of Xenportal - It requires xenforo to be installed in the root.
  7. Brogan

    Brogan XenForo Moderator Staff Member

    It should just be a matter of updating the config.php file.

    This is from the add-on thread:
    DaveL likes this.
  8. DaveL

    DaveL Well-Known Member


    Just had a look in my 301config.php file and this is what I have:

    /* ----------------------------------------------------------- *\
    This variable defines where XenForo is installed.
    If you have not installed XenForo into the same directory in which
    IP.board was installed, you will need to provide the full path to
    the XenForo directory here. Remove the leading // and then enter
    the path as in the following examples:
    #    $fileDir = '/home/example/public_html/new_forums';
    #    $fileDir = 'C:/inetpub/wwwroot/xenforo';
    \* ----------------------------------------------------------- */
    //    $fileDir = '/home/username/www/forums';
    /* ----------------------------------------------------------- *\
    This constant defines the table from which the import redirection
    scripts will fetch their data. Normally they will use the table
    'xf_import_log', but if you have archived your import data, you
    should provide the name of the archive table here. Remove the
    leading // and then replace 'import_log_x' with the name of your
    archive table, as in the following examples:
    #    define('IMPORT_LOG_TABLE', 'my_import_log');
    #    define('IMPORT_LOG_TABLE', 'import_log_my_forums');
    \* ----------------------------------------------------------- */
    When I converted over I had major issues with the redirect and Kier had a log into my site and do it. Is there anywhere else I should look?
  9. DaveL

    DaveL Well-Known Member

    Would this in my .htaccess file have anything to do with it?

    # IPS Rewrite Rules
        RewriteCond %{REQUEST_URI} /forum/(topic|forum|user)/
        RewriteRule ^.*$ ips2xf.php [NC,L]
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d   
        RewriteRule ^.*$ - [NC,L]   
        RewriteRule ^(data|js|styles|install/|favicon\.ico) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
  10. DaveL

    DaveL Well-Known Member

    I thought I would give it a ago and see what happens.

    I edited the Basic Board Information so it showed the domain without /forum
    I then moved all the files from /forum into my root directory and all seemed well!, However when I clicked on anything it was still looking for the /directory and throwing up server errors everywhere.

    I then edited the .htaccess in the post above to remove the /forum section, but that didnt work either. Im just in the process of moving everything back into the /forum folder.

    I think i'll have to wait till Kier replies to see what settings he changed when you sorted out mu re-direct issue.
  11. DaveL

    DaveL Well-Known Member

    I think I may have cracked it! There was a line in the .htaccess file I had to // out to make it work!

    One question though, What would I need to put in my .htaccess so anyone trying to access a link from google with /forum in the domain will now be re-directed to my domain without the /forum.

Share This Page