• 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

DaveL

Well-known member
#1
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?
 

jadmperry

Well-known member
#3
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).
 

Brogan

XenForo moderator
Staff member
#4
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.
 

DaveL

Well-known member
#5
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!
 

Brogan

XenForo moderator
Staff member
#7
It should just be a matter of updating the config.php file.

This is from the add-on thread:
Moved Directory

If you have installed XenForo in a different directory from where your IPB used to reside, you will need to edit the included 301config.php file in order to specify the full file path to your XenForo installation, as in this example:
PHP:
$fileDir = '/home/example/public_html/xenforo-forum';
http://xenforo.com/community/threads/redirection-scripts-for-invision-power-board-3-1-x.14652/
 

DaveL

Well-known member
#8
Hmm,

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

PHP:
<?php
 
/* ----------------------------------------------------------- *\
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');
#
\* ----------------------------------------------------------- */
 
define('IMPORT_LOG_TABLE', 'archived_import_log');
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?
 

DaveL

Well-known member
#9
Would this in my .htaccess file have anything to do with it?

Code:
# 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]
 

DaveL

Well-known member
#10
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.
 

DaveL

Well-known member
#11
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.