XF 1.1 1 htaccess file wth 2 redirects?

snoopy5

Well-known member
Hi

After my import of several vbforums into 1 xf forum, I want to put now htaccess files in the old vb locations. All vbforums have a different domainname than the XF forum.

currently it is

Code:
RedirectPermanent / http://mydomainname.com

The problem is that the users often save two different bookmarks for the old vbforum.

1. www.domainname.com
2.www.domainname.com/forum/index.php

With my current redirect, I only redirekt #1. With #2 comes an error.

How can I add in the same htaccess file another redirect for #2?
 
Have you looked at the XF redirection scripts that will redirect each old url to your new install?
hate to lose any of the old urls
http://xenforo.com/community/resources/categories/redirection-scripts.2/


Hi

I thought these redirection scripts work only if I import onyl 1vb into 1 xf forum. But in my case, I imported 10vb forums in 1 xf forum and changed the structure of the xf forums compared to the old vb forums.

Would these xf redirect scripts then still find the right threads?
 
These redirect scripts will work as long as you saved the import log from each import:

http://xenforo.com/community/resources/redirection-scripts-for-vbulletin-3-x.264/

At the end of each import it would have given you the option to archive the import log, thus allowing you to save logs for each import. The redirect scripts have a 301config.php file which allows you to specify the name of the import log table.

But to answer your original question... I suggest rewrite rules. This would go into your .htaccess file in the web root, assuming the /forum directory does not exist:

Code:
RewriteEngine On

RewriteRule ^forum/index\.php$ http://mydomainname.com/? [R=301,L]
 
Hi

I thought these redirection scripts work only if I import onyl 1vb into 1 xf forum. But in my case, I imported 10vb forums in 1 xf forum and changed the structure of the xf forums compared to the old vb forums.

Would these xf redirect scripts then still find the right threads?
Yes the redirect script files are placed each of the 10 old vBulletin forum directories (if you still have access to them.)
 
Hi

I have all import logs. So this should be fine. In the instructions, I found to spots where I might run into problems:

Version 2 - December 9th 2010

The original version of this system required that XenForo be installed into the same directory that vBulletin was installed.

Version 2, now attached to this post, allows you to specify a different directory in which XenForo is installed.

To do this, simply edit the included 301config.php file, un-comment the $fileDir = '/some/path/here' line and then replace the value for $fileDir with the full path to your XenForo installation, for example:
PHP:
$fileDir = '/home/example/public_html/xenforo-forum';

How can I deal with this, if the XF Forum is not only in another dierctory, but also with another domainname? (on the same server). How do I need to change this then?



Note that the 301config.php, showthread.php, forumdisplay.php and showpost.php files must still be placed in the directory in which vBulletin was installed for this to work.

Version 4 - March 29th 2011

This new version includes a rewriting system for printthread.php, attachment.php and the vBulletin 3 'search-engine-friendly' archive system. Simply overwrite your existing files, except 301config.php, which has not changed, and include the new archive/index.php file.

Currently I have the vb forums in maintenance mode. Do I need to change this for the redirect to work?

If I overwrite vb files, is there still a ways afterwords to have admin access via another URL to the vb forums?

I often need still access to double check if users can not login into XF after the import and tell me their username. I check then in the vbforum for that username and solve any open questions.
 
How can I deal with this, if the XF Forum is not only in another dierctory, but also with another domainname? (on the same server). How do I need to change this then?

It would be best to setup a separate redirect for the change of domain. If vB was in /forum on the old site then use this in a .htaccess file in that old /forum directory:

Code:
Redirect 301 /forum/ http://www.newdomain.com/forum/

Then create a /forum directory on the new domain and upload the redirect scripts to there.

Currently I have the vb forums in maintenance mode. Do I need to change this for the redirect to work?

No.

If I overwrite vb files, is there still a ways afterwords to have admin access via another URL to the vb forums?

Don't delete the vB files. Then you will have access. You only need to overwrite the PHP files that have redirect scripts, like showthread.php.
 
mmmhhhhhh.... does not work for me. It seems that in my constellation, I need a different directory name.

When I do it as described above, the redirect url in the browser is then:

mydomainname2.com/forum/index.php

but the correct url of my XF forum is:

mydomainname2.com/index.php

So this part "/forum/" seems to be wrong. But no matter what I change in the 301config.php file, this "/forum" does not go away.

-----------

current setup:

all on the same server

domainname 1 with vb installed in directory 1, which is "forum". So the vb forum is accessable under

mydomainname1.com/forum/index.php

in this /forum directory are all vb files. I copied all files of the XF redirect package into this, except the 301config.php. Additionally I put a .htaccess file into the same directory with the text:

Redirect 301 /forum/ http://www.mydomainname2.com/

in the XF directory (directory2), I created a subdirectory "forum". In this one I put the 301config.php file with the code:

Code:
<?php
 
/* ----------------------------------------------------------- *\
This variable defines where XenForo is installed.
 
If you have not installed XenForo into the same directory in which
vBulletin 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 = '/mypathtonewxfforum';
 
/* ----------------------------------------------------------- *\
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_special');

This '/mypathtonewxfforum' is the full path to the xf forum. So the directory for mydomainname2.com. This is not the mydomainname2.com/forum/ directory with the 301config.php in it

No matter what I change in this setting, the result are always the same. I get in the browser the mydomainname2.com/forum/index.php instead of mydomainname2.com/index.php. Even if I leave the /mypathtonewxfforum/forum/ directory empty.

Any ideas what I do wrong?

and the second question would be: Since I have imported 10 different vb forums with 10 different log files, how do I apply these 10 at the same time in the 301config.php?
 
mmmhhhhhh.... does not work for me. It seems that in my constellation, I need a different directory name.

When I do it as described above, the redirect url in the browser is then:

mydomainname2.com/forum/index.php

but the correct url of my XF forum is:

mydomainname2.com/index.php

So this part "/forum/" seems to be wrong. But no matter what I change in the 301config.php file, this "/forum" does not go away.

That means this setting is wrong:

Admin CP -> Home -> Options -> Basic Board Information -> Board URL

Remove the /forum part from this URL. The redirect scripts use this setting to build the forum links.
 
and the second question would be: Since I have imported 10 different vb forums with 10 different log files, how do I apply these 10 at the same time in the 301config.php?

You would have 10 different sets of redirect scripts at each of the original vB forum locations. Each 301config.php file would have a different import log specified.
 
That means this setting is wrong:

Admin CP -> Home -> Options -> Basic Board Information -> Board URL

Remove the /forum part from this URL. The redirect scripts use this setting to build the forum links.

There is no forum part in that URL. It is only "http//mydomainname2.com"


You would have 10 different sets of redirect scripts at each of the original vB forum locations. Each 301config.php file would have a different import log specified.

But as you posted earlier in this thread, with my specific constellation, I need to put the 301config.php file in a new directory "forum" in the XF directory, not the one of the vb dirctory. If I put in the xf directory 10x a 301config.php file, how does one know which file is for which vb forum, since all 10 are then in one singel forum directory?
 
Well in your case there are two redirects. You need to test each one separately to make sure they are working. One changes the domain, the other uses the redirect scripts to map the old URL to the new XenForo one.

To maintain separation between the different vB domains you can setup different forum directories on the new domain that contain different sets of redirect scripts.
 
Top Bottom