vBulletin 4.x URL Redirection

vBulletin 4.x URL Redirection 1.0.0

No permission to download

Add these rules to the top of the .htaccess file in the web root of http://forums.wirelessadvisor.com/ :

Code:
RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-[^\./]+-([0-9]+)\.html$ /threads/$1/page-$2 [R=301,L]
RewriteRule ^[^/]+/([0-9]+)-[^\./]+\.html$ /threads/$1/ [R=301,L]

That will take care of your thread links which is the most important thing.
 
Little confused about this.. I'm converting a vB (Non vBSEO) forum to a new fresh XF forum retaining ID's and I'm running Nginx.

Do I still need to download this mod, and then can anyone help me with redirects?

OLD
http://www.thetruckstop.us/forum/showthread.php?33576-RPO-Codes-List

NEW (jhunt.me) is just temporary until I go live)
http://www.jhunt.me/forum/threads/rpo-codes-list.33576/

The "standard-basic-advanced" package in this addon will work for your URLs. Upload those PHP files to your /forum directory where vB is/was.
 
The "standard-basic-advanced" package in this addon will work for your URLs. Upload those PHP files to your /forum directory where vB is/was.

Thank you..

I'm taking the vB DATA to a new server to do a XenForo import and run it there (under a fresh XF installation). I put these files on the new XF server in the root of forum/ correct?
 
I put these files on the new XF server in the root of forum/ correct?

The redirect scripts need to be in the old vB location. If you are testing XF on a temporary domain then you can upload the scripts to that temporary domain for testing purposes.
 
the redirect scripts work the same on lighttpd without any changes. They are fake VB scripts that convert the parameters in a request, then redirect in PHP code to the equivalent XF page.

Server configuration rules are onyl needed for redirects if you move the site between directories on the migration. Rules are then standard Lighttpd redirects that you can get from any tutorial / Lighttpd help, eg:

http://fooninja.net/2010/09/12/lighttpd-mod_rewrite-examples/

If you need normal XF SEF type rules, there are threads discussing this, and an XF help: https://xenforo.com/help/friendly-urls/
 
Last edited:
I have problem after conversion:
old link:
xboxforum.pl/jtag-rgh-194/sprzet-do-rgh-co-bedzie-potrzebne-145920/
new link:
xboxforum.pl/threads/sprzet-do-rgh-co-bedzie-potrzebne.95706/

I'm use http://tools.geekpoint.net/xfseo/ and my xml file form vbseo and get:
Code:
RewriteEngine on
RewriteRule [^/]+-[\d]+/.+-([\d]+)/index([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+-[\d]+/.+-([\d]+)/ showthread.php?t=$1 [NC,L]
RewriteRule [^/]+-([\d]+)/index([\d]+).html forumdisplay.php?f=$1&page=$2 [NC,L]
RewriteRule [^/]+-([\d]+)/ forumdisplay.php?f=$1 [NC,L]

Colud you help me make rewriet to lighttpd?

Current I have:
Code:
url.rewrite = (
"^/(data|install|images|js|styles)/(.*)$" => "$0",
"^/(.*\.php)(.*)$" => "$0",
"^/.*(\?.*)" => "/index.php$1",
"" => "/index.php"
)
 
The patterns stay the same, you just put them in the Lighttpd syntax - this is an extract from my config that corresponds with yours above. Note these come from my non-standard VBSEO URLs so you can't copy and paste.

url.rewrite-once = (
"[^/]+/([\d]+)-.+-([\d]+).html" => "/community/showthread.php?t=$1&page=$2",
"[^/]+/([\d]+)-.+.html" => "/community/showthread.php?t=$1",
"[^/]+-([\d]+)-([\d]+).html" => "/community/forumdisplay.php?f=$1&page=$2",
"[^/]+-([\d]+)" => "/community/forumdisplay.php?f=$1",

.............
etc
)

This is to redirect your old VBSEO URLs to the VB 'fake' scripts - showthread.php etc (These files will then convert and redirect the URLs to Xenforo).

The second rules you have posted are for XF SEF URL's.

So, put another way, these are two separate issues:

1. The first rules are dealing with your old rewrites - what VBSEO used to handle. The resulting URLs point to VBulletin files, exactly as before (this modification replaces those files with the XF redirect files).
2. The second are for pure XF.

I would suggest you start with step 1 - just get the VBulletin/VBSEO rules and the scripts from this mod working. Don't use XF SEF URLs at this stage,

Next step 2. Turn on the XF SEF URLs and get that working.

The two sections may conflict, but you won't know until you try.
 
By the way, I ended up doing 'Stage 2' with mod_magnet, as kindfly explained by AlexT here: https://xenforo.com/community/threads/lighttpd-url-rewrite-with-mod_magnet.48055/

I had a mix of Wordpress, Mediawiki, PHPBB and VBulletin URLs and getting the rules working without conflict was really tricky, hence why I don't just post my rules - they're chaotic and largely useless outside my own system. Anyway I found in my particular circumstance that using the mod_magnet solution worked better. Worth trying if you get frustrated with the XF SEO rules you posted above (your second code segment)
 
I'm used rewrite rules:
Code:
url.rewrite = (
        "[^/]+/([\d]+)-.+-([\d]+).html" => "/showthread.php?t=$1&page=$2",
        "[^/]+/([\d]+)-.+.html" => "/showthread.php?t=$1",
        "[^/]+-([\d]+)-([\d]+).html" => "/forumdisplay.php?f=$1&page=$2",
        "[^/]+-([\d]+)" => "/forumdisplay.php?f=$1",
        "^/(data|install|js|styles|images)/(.*)$" => "$0",
        "^/(.*\.php)(.*)$" => "$0",
        "^(/favicon\.ico|/robots\.txt)$" => "$1",
        "^/.*(\?.*)" => "/index.php$1",
        "" => "/index.php"
)

redirectins works but don't completly

example:
link form google http://xboxforum.pl/gta-v-261/zgrywanie-contentu-na-pendrive-gta-v-dvd1-175214 redirecting to http://xboxforum.pl/forums/gta-v.20/ this is good forum but no't redirecting to thread
 
Yes I'm add mod_magnet and file:
Code:
server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_rewrite",
        "mod_expire",
"mod_magnet"
)

Code:
$HTTP["host"] == "xboxforum.pl" {
server.document-root = "/home/dvd/xboxforum.pl/"
index-file.names = ( "index.php" )
magnet.attract-physical-path-to = ( "/etc/lighttpd/xenforo.lua" )
url.rewrite = (
"[^/]+/([\d]+)-.+-([\d]+).html" => "/showthread.php?t=$1&page=$2",
"[^/]+/([\d]+)-.+.html" => "/showthread.php?t=$1",
"[^/]+-([\d]+)-([\d]+).html" => "/forumdisplay.php?f=$1&page=$2",
"[^/]+-([\d]+)" => "/forumdisplay.php?f=$1",
        "^/(data|install|js|styles|images)/(.*)$" => "$0",
        "^/(.*\.php)(.*)$" => "$0",
        "^(/favicon\.ico|/robots\.txt|/BingSiteAuth\.xml)$" => "$1",
        "^/.*(\?.*)" => "/index.php$1",
        "" => "/index.php"
)
}

etc/lighttpd/xenforo.lua
Code:
attr = lighty.stat(lighty.env["physical.path"])
if (not attr) then
  lighty.env["uri.path"] = "/index.php"
  lighty.env["physical.rel-path"] = lighty.env["uri.path"]
  lighty.env["request.orig-uri"]  = lighty.env["request.uri"]
  lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"]
end

I don't see any different - links don't works :/
 
I'm back to my config:
Code:
url.rewrite = (
"^/(data|install|images|js|styles)/(.*)$" => "$0",
"^/(.*\.php)(.*)$" => "$0",
"^/.*(\?.*)" => "/index.php$1",
"" => "/index.php"
)
and analyse.

1. xboxforum.pl/showthread.php?t=145920 ==> xboxforum.pl/threads/sprzet-do-rgh-co-bedzie-potrzebne.95706/ (works fine, links are connected correct)
2. xboxforum.pl/jtag-rgh-194/sprzet-do-rgh-co-bedzie-potrzebne-145920/ (google link) ==> don't works, correct link is xboxforum.pl/threads/sprzet-do-rgh-co-bedzie-potrzebne.95706/

Any suggestion?
 
Hey folks,

Just purchased XF and about to import from VB4. Need clarification on what to do. Was using standard URLs (with DBSEO plugin).

This is my original VB4 .htaccess in root folder (domain.com is how VB was installed).

Code:
RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.talkjesus\.com
RewriteRule (.*)  http://www.talkjesus.com/$1 [L,R=301]

RewriteCond %{REQUEST_URI} !(admin-access/|mod-access/|cron)
RewriteRule ^((archive/)?(.*\.php(/.*)?)?)$ dbseo.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admin-access|mod-access|clientscript|cpstyles|images|gallery)/
RewriteRule ^(.+)$ dbseo.php [L,QSA]

## Rewrites
<ifmodule mod_rewrite.c>
    RewriteEngine on
    Options +FollowSymlinks

    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]

    # Forum
    RewriteRule ^threads/.* showthread.php [QSA]
    RewriteRule ^forums/.* forumdisplay.php [QSA]
    RewriteRule ^members/.* member.php [QSA]
    RewriteRule ^blogs/.* blog.php [QSA]
    ReWriteRule ^entries/.* entry.php [QSA]
    RewriteRule ^.*$ /s/yourls-loader.php [L]

    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]

    # MVC
    RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
   
</ifmodule>

## Expires
<ifModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 year"
    ExpiresByType text/javascript "access plus 1 year"
    ExpiresByType application/javascript "access plus 1 year"
    ExpiresByType application/x-javascript "access plus 1 year"
</ifModule>

<Files 403.shtml>
order allow,deny
allow from all
</Files>

So, aside uploading the standard-basic-advanced files into root folder, is there anything else I need to do to avoid losing SEO credibility?

Thanks.
 
Well, I got a problem. Actually I didn't create an import log back in the days when I imported the vb4 stuff.
After installing the addon and uploading the files, the redirections don't work.
I'm using lighttpd and this is how URLs changed.

From https://high-minded.net/showthread.php?23094-XYZ

to https://high-minded.net/threads/23094

Is there a way for me to get redirection working?

The import_log table is usually named one of these things:

xf_import_log
archived_import_log


If those tables don't exist or are empty then you can populate the default xf_import_log table with a thread_id map by running this query:

Code:
	INSERT INTO xf_import_log (content_type, old_id, new_id)
		SELECT 'thread', thread_id, thread_id
		FROM xf_thread
	ON DUPLICATE KEY UPDATE
		old_id = VALUES(old_id)

That should allow you to use these redirect scripts for threads.
 
The import_log table is usually named one of these things:

xf_import_log
archived_import_log

That should allow you to use these redirect scripts for threads.

Great, I found the import log and edited the 301config.php acordingly and it's working now, thanks for the help.
 
@brattanek you have an unholy mix of rules that try to do two different things - in fact if you include the lua file then you have three different sets that try to do two different things. I'm still not sure that this is clear to you:

- the rule set that you got from the VBSEO converter site is to redirect old VB URLs to the showpost.php etc files from this modification.
- the rule set below is totally different and is used for Xenforos SEF URL system.

Code:
url.rewrite = (
"^/(data|install|images|js|styles)/(.*)$" => "$0",
"^/(.*\.php)(.*)$" => "$0",
"^/.*(\?.*)" => "/index.php$1",
"" => "/index.php"
)

You cannot just glue them together and hope it works, and if you use the lua solution to implement Xenforo SEF URLs then you don't use the rules above at all.

Can you post the rules that you used to get the VB URL (my step one) working correctly, and I'll compare with my own config and see if I can then give you the complete version. Please confirm that everything is working correctly (standard Xenforo - no SEF) before that.
 
Top Bottom