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

XF 1.2 Migrating from vb3.8.7 + vbseo - Thread Redirection Issue

Neutral Singh

Well-known member
#1
Finally taking a plunge... :) vBulletin Forum is installed at root, http://www.sikhphilosophy.net

What i have done so far...

1. I installed xenforo 1.2.1 in a directory on the root and imported data from vB with no issues and moved the new forum to the root.

2. Downloaded the vbseo-all.xml and generated the rewrite rules from http://tools.geekpoint.net/xfseo/ for the .htaccess file.

RewriteEngine on
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]

3. Downloaded and uploaded Version 6 of the redirection files at the following link:

http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/

4. Edited the 301config.php and put the following:

$fileDir = '/home/******/public_html';

5. The forum url redirection seems to working fine. eg.

Redirect 301 /sikh-sikhi-sikhism http://www.sikhphilosophy.net/forums/sikh-sikhi-sikhism

6. Problem: My typical thread url looks like this:

http://www.sikhphilosophy.net/movies-and-cinema/41303-ashdocs-movie-review-the-conjuring.html

And it's simply not working! :confused: What am i doing wrong? :cry:

Thanks!
 
Last edited:

Jake Bunce

XenForo moderator
Staff member
#2
Aside from those general instructions you found, if you need help with your redirects then I need an example old and new thread URL from both vB and XF. Then I can be certain about your specific redirects and provide exact instructions.
 

Jake Bunce

XenForo moderator
Staff member
#4
The ids are the same so you don't need the PHP redirect scripts. You only need rewrites.

Add this to the top of the .htaccess file in your web root:

Code:
RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html$ /threads/$1/ [R=301,L]
That should do it.
 

Neutral Singh

Well-known member
#6
@Jake Bunce

You said that i do not need redirect scripts by Kier, what if i also need to do redirects for showpost.php, members.php, printthread.php, for that matter for all the dummy redirect files.

What would be the redirect rules for the above php files.

Thank you sooooo much! :)
 

Jake Bunce

XenForo moderator
Staff member
#7
@Jake Bunce

You said that i do not need redirect scripts by Kier, what if i also need to do redirects for showpost.php, members.php, printthread.php, for that matter for all the dummy redirect files.

What would be the redirect rules for the above php files.

Thank you sooooo much! :)
Does your vB forum use those file names in the URLs (showpost.php, members.php, printthread.php)? If so then you can put those php scripts into place and they will work as is. But if those types of URLs in vB are rewritten to be "friendly" then you will need to use rewrite rules anyways in which case there is no need to use those php scripts since your ids are the same.

Long short, give me examples of old and new URLs in vB and XF and I will construct more rewrites for you.
 

Jake Bunce

XenForo moderator
Staff member
#9

Neutral Singh

Well-known member
#10
@Jake Bunce

All of the redirects you provided above are working perfectly except the following...

I copied the following code in .htaccess file. The following rule is not working as desired.

Code:
RewriteEngine On
RewriteRule ^members/([^\.]+)\.html$ /member_redirect.php?username=$1 [R=301,L]
Member's old url: http://www.sikhphilosophy.net/members/gyani-jarnail-singh.html

Following error message shows up: user not found

This url shows-up in address bar: http://www.sikhphilosophy.net/member_redirect.php?username=gyani-jarnail-singh

It should redirect to: http://www.sikhphilosophy.net/members/gyani-jarnail-singh.189/
 

Jake Bunce

XenForo moderator
Staff member
#11
@Jake Bunce

All of the redirects you provided above are working perfectly except the following...

I copied the following code in .htaccess file. The following rule is not working as desired.

Code:
RewriteEngine On
RewriteRule ^members/([^\.]+)\.html$ /member_redirect.php?username=$1 [R=301,L]
Member's old url: http://www.sikhphilosophy.net/members/gyani-jarnail-singh.html

Following error message shows up: user not found

This url shows-up in address bar: http://www.sikhphilosophy.net/member_redirect.php?username=gyani-jarnail-singh

It should redirect to: http://www.sikhphilosophy.net/members/gyani-jarnail-singh.189/
That error means the script can't find the username.

Does that user's username show different in the URL? If the URL username is not the same as his actual username then the redirect won't work. This is likely to be the case for some usernames with special characters which might have been filtered out of the URL.
 

Neutral Singh

Well-known member
#12
@Jake Bunce

I am attaching images of the vbseo settings i had in vB. First one is for member urls, 2nd and 3rd are for Albums. Please advice. Thank you so much!

There are no special character in usernames.

Member's old vbseo url: http://www.sikhphilosophy.net/members/gyani-jarnail-singh.html

Should redirect to New url: http://www.sikhphilosophy.net/members/gyani-jarnail-singh.189/


Just realized that i need redirects for old vB Album urls:


Old vbseo Url: http://www.sikhphilosophy.net/members/narayanjot-kaur-albums-birds-gurbani.html

Typical New Url: http://www.sikhphilosophy.net/media/albums/the-birds-of-gurbani.3/


Old vbseo Url: http://www.sikhphilosophy.net/vb/me...ure65-sparrow-hawk-hawk-mentioned-only-5.html

Typical New Url:http://www.sikhphilosophy.net/vb/me...ure65-sparrow-hawk-hawk-mentioned-only-5.html
 

Attachments

Jake Bunce

XenForo moderator
Staff member
#14
Does that user's username show different in the URL than in the database? If so then the redirect simply can't work unless you can find a map in your vB database.

The first album URL doesn't have any id or slug in common with the new XF URL so it can't be automatically redirected

The second album URL is the same as its target so no redirect is needed (the old and new URL you posted are the same).
 

Jake Bunce

XenForo moderator
Staff member
#16
@Neutral Singh

Add these rules to the top of the .htaccess file in your web root:

Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} (^|\?)pg=(sponsor-sikh-philosophy-network)$
RewriteRule ^view\.php$ /pages/%2/? [R=301,L]

RewriteCond %{QUERY_STRING} (^|\?)pg=(gurmukhi-fonts)$
RewriteRule ^view\.php$ /pages/download-%2/? [R=301,L]

RewriteRule ^sitemap\.php$ /sitemap/ [R=301,L]