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

XF 1.2 Help needed with rewrites from vBSEO

#1
Hi Guys,

Firstly please excuse me I am incredibly rusty on forum admin side of things as I have had health issues for the past year so whatever I learnt from a few years of running a vB site is a little rusty right now :)

Basically I want to convert my vB4.1.x & vBSEO site over to xF. The problem I am having is I'm not really knowledgeable when it comes to SEO so I need a helping hand.

What I've done so far:
  1. created a new SQL DB and have installed a fresh XF 1.2 B5 install as a test.
  2. imported my old vB test forum into the new XF system/db and all running without a hitch.
I've just spent an hour on this site searching various threads regarding rewrites from vBSEO to xF so I don't lose google hits/etc and I've confused myself silly with old posts vs newer methods ETC.

Could someone please tell me in as black and white fashion as possible what I need to do as xF is completely new to me right now so please bare that in mind.

My forum URLS vis vBSEO are set to: 001 - Hierarchic .html type URLs with content relevant forums and threads (Default Settings)

Original VBSEO/VB URL:
http://www.domain.name/vbtest/general-discussion/441-wonder-if-will-work.html#post498

Current xF url:
http://www.domain.name/XFTEST/index.php?threads/wonder-if-this-will-work.441/#post-498

Any help and guidance would be really magnificent, Thanks so much! :)
 
#3
Hi mate and thanks for the quick response.

Yep I found that url and created the rewrites but then got EXTREMELY confused as I couldn't find showthread etc in the XF directory and also the link provided to kiers rewrites are for vB3 and not for vb4+vbseo so hence my major confusion!

Treat me like a complete noob when it comes to vBSEO as it was always like a unicorn to me, a mystical beast I installed and never touched :) so any further help would be fantastic.
 
#4
Hi all!

I just implemented the steps, but my links are redirecting to the home page.

Is this an old VB link
Code:
http://www.tumaternidad.com/consejos-familiares/74-mi-bebe-puja-mucho.html
This is what the rewrite in .htaccess creates
Code:
http://www.tumaternidad.com/showthread.php?t=74
and this is the correct link in xenFORO
Code:
http://www.tumaternidad.com/threads/mi-bebe-puja-mucho.74/
My VB forum was placed on the root so I placed Kier: Redirection Scripts for vBulletin 3.x. in the root ( no vb folder)

this is my .htaccess
Code:
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
Any idea what I am missing?
 

Jeremy

Well-known member
#6
Hi mate and thanks for the quick response.

Yep I found that url and created the rewrites but then got EXTREMELY confused as I couldn't find showthread etc in the XF directory and also the link provided to kiers rewrites are for vB3 and not for vb4+vbseo so hence my major confusion!

Treat me like a complete noob when it comes to vBSEO as it was always like a unicorn to me, a mystical beast I installed and never touched :) so any further help would be fantastic.
You need this:
http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/

And the import log if you didn't opt to keep the same IDs.
 
#7
You need this:
http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/

And the import log if you didn't opt to keep the same IDs.
Thanks, I've read with interested but my old url is now defaulting the the default XF forumdisplay it does NOT jump the the thread/post/

This is what I've done.

  1. copied Kier's files and edited the 301display with the full url to my xF testforum
  2. generated the vBSEO settings and created a .htaccess file within my old vBTEST directory (where kiers files are stored)
.htaccess looks like this (no further content in the file)

Code:
RewriteEngine on
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
But as I've said when I goto the old vbtest thread it now jumps me to the forumdisplay on XF and does not display the thread/post.

I'm not sure what is meant by the import.log as I ticked the option when doing the VB->XF conversation as suggested so I don't think I need that?

Where would I find the xf_import_log if i were to try and add this to see if changes anything?
 
Last edited:

Jeremy

Well-known member
#8
You had the option to store the Import Log as the last step of your import process. I believe it asked you for a table name, but you should be able to find it by inspecting the tables in your database.
 
#9
Still not working @King Kovifor :(

The log was called xf_import_log so changed the filename in 301 but still defaulting back to the forumdisplay and not the thread :

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 = '/var/www/vhosts/mysite.com/httpdocs/XFTEST';
/* ----------------------------------------------------------- *\
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', 'xf_import_log');
 

Jeremy

Well-known member
#10
Unfortunately, I am not very good at URL rewrites. Any further support may put you in a worse state, so I shall bow out and let more knowledgeable users help you solve this.
 
#11
Well upon inspection for anyone else who may try and help I've looked at the table on xf_import_log and it's empty but i also have a table called 'archived_import_log' which has content so I've changed the 301 to that and still the same problem.. :(


HELP please!! :(
 

Jake Bunce

XenForo moderator
Staff member
#12
The import log is not necessary in your case since the ids are the same.

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

Code:
RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html /XFTEST/index.php?threads/$1/ [R=301,L]
That's it.
 
#13
@Jake Bunce Thank you for your input I have found something quite strange going on.

I got it working with or without your addition on Firefox and Chrome but using IE10 it defaults to the forumdisplay and not the thread/post with or without your addition.

Any ideas?
 
#15
When you click on an old thread link? Can you provide the link so I can test it?
Code:
http://www.myspain.es/vbtest/general-discussion/441-wonder-if-will-work.html#post498
As I said, working fine in FF and Chrome but in IE10 it defaults to list of forums (formdisplay)

Thanks for any input.
 
#17
Thank you @Jake Bunce for confirming that for me. I'll have a look on another laptop running IE10 to see what's going on so just to confirm this is my htaccess file is this all ok? it seems to work! :)

Code:
RewriteEngine on

RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html /XFTEST/index.php?threads/$1/ [R=301,L]
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
Can't wait for xF1.2 to go gold so I can move the live site over now I'm not scared to death of replacing vBSEO urls :)

Thanks so much for your help mate!
 
Last edited:
#18
Hi guys and perhaps @Jake Bunce could further help.

I've just gone live with my site and rewrites seem to be working just great but upon logging into the admin panel I'm getting lots of errors regarding the old vb archive.

For example of one:

Code:
Error Info
ErrorException: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Compilation failed: unrecognized character after (?&lt; at offset 27 - /var/www/vhosts/domain.com/httpdocs/forum/archive/index.php:19
Generated By: Unknown Account, Today at 8:18 PM
Stack Trace

#0 [internal function]: XenForo_Application::handlePhpError('#/archive/index...', '/forum/archive/...', NULL)
#1 /var/www/vhosts/domain.com/httpdocs/forum/archive/index.php(19): preg_match()
#2 {main}

Request State

array(3) {
  ["url"] => string(61) "http://www.domain.com/forum/archive/index.php/f-33-p-301.html"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Obviously search engines have made good use of my old vB archive so I'm eager to get this working if possible?

Thank you.