Resource icon

Redirection Scripts for vBulletin 3.x 8.0

No permission to download
ok,I see what it is. I have vb2 links & vb3 links. it's the vb2 links that are broken.

if the links are like this
http://www.sternfannetwork.com/forum/showthread.php?s=&p=924138
or
http://www.sternfannetwork.com/forum/showthread.php?t=301353

they work but my broken links aren't like that. mine spell out postid & threadid like this
http://www.sternfannetwork.com/forum/showthread.php?s=&postid=924138
http://www.sternfannetwork.com/forum/showthread.php?threadid=301353

i'll just edit the scripts to handle both types
 
I edited all the files to work for both vb3 & vb2 links.if anyone needs htem I'd be happy to provide the edits.



I have a new problem though. The server logs are riddled w/ this error
Code:
ErrorException: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Compilation failed: unrecognized character after (?&lt; at offset 27 - /var/www/virtual/sternfannetwork.com/public_html/forum/archive/index.php:19
loading the page gives the same error.
THIS IS THE ORIGINAL FILE

this is line 19
Code:
if (preg_match('#/archive/index.php(/|\?)(?<type>f|t)-(?<id>\d+)\.html#si', $_SERVER['REQUEST_URI'], $input))
{

I changed the line to this & now it works
Code:
if (preg_match('#/archive/index.php(/|\?)(?P<type>\w+)-(?P<id>\d+)\.html#si', $_SERVER['REQUEST_URI'], $input))

don't ask me why. it's just code I copied & pasted off PHP.net
 
ok,I see what it is. I have vb2 links & vb3 links. it's the vb2 links that are broken.

if the links are like this
http://www.sternfannetwork.com/forum/showthread.php?s=&p=924138
or
http://www.sternfannetwork.com/forum/showthread.php?t=301353

they work but my broken links aren't like that. mine spell out postid & threadid like this
http://www.sternfannetwork.com/forum/showthread.php?s=&postid=924138
http://www.sternfannetwork.com/forum/showthread.php?threadid=301353

i'll just edit the scripts to handle both types

Confirmed. Those are vB2 links. vB3 and vB4 support the old vB2 links for backwards compatibility. For the purpose of importing and redirects those vB2 links aren't normally a concern because they are so old and will not have been used since the time you were running vB2, except perhaps for old bookmarks or user-submitted links.

http://xenforo.com/community/thread...post3324-to-xf-postid-1234.21414/#post-271383
 
Confirmed. Those are vB2 links. vB3 and vB4 support the old vB2 links for backwards compatibility. For the purpose of importing and redirects those vB2 links aren't normally a concern because they are so old and will not have been used since the time you were running vB2, except perhaps for old bookmarks or user-submitted links.

http://xenforo.com/community/thread...post3324-to-xf-postid-1234.21414/#post-271383

yeah but I have old photo gallery threads that people still check out & the links in the posts didn't work. hell, I'm surprised I don't still have UBB links in there. thanks
 
Are there any instructions on how to use this with vB3 and vBSEO?
e.g.
Code:
http://www.avforums.com/forums/plasma-tvs/1738201-samsung-f8500-plasma.html
 
Thanks, that's useful. Except I get this:
Thread Paging
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
Thread
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
Forum Paging
Unsupported url format.
Forum
Unsupported url format.
I made a bad decision a long time ago to use the forum title for the SEO link to a forum.
e.g. http://www.avforums.com/forums/digital-photography/
I guess I'm going to have to create a manual 301 redirect to a new format which uses the forum id?
 
Thanks, that's useful. Except I get this:

Yep, use those rewrite rules are for threads.

Some vBSEO formats don't contain forum_ids in the forum URLs. That's probably why it says forums are unsupported. But threads are the most important thing to redirect.
 
The hash part of the URL (# or after) is not sent to the server so it's impossible to do any redirection based on it.
 
What would you guys recommend if I want to keep my forums location? For example:

My vB is here http://myvbforumxyz/forums
My XF (I want it there too, so in /forum/)

How am I doingt that?

In the same directory? Simply move the vB files out and the XF files in. These redirect scripts can go into the same directory along with your XF files in order to redirect the old vB links.
 
Doesn't work, I used vbseo before and imported all threads, posts etc. configuration in XF is correct but it doesn'T redirect me to the correct pages :(
 
Doesn't work, I used vbseo before and imported all threads, posts etc. configuration in XF is correct but it doesn'T redirect me to the correct pages :(

What exactly is happening? Can you provide an example before and after thread URL?
 
okay, so I've read upwards and seen that some others wanted redirect from one site to another

... I wanted to use this plugin too (but it's for forums on the same site), ... However, I've managed to start doing it with out the use of dummy fourms, and just using htaccess


I wanted to redirect

1) example.com
2) example.com/forumdisplay.php?f=x
3) example.com/showthread.php?t=y

to

1) example2.com/forum
2) example2.com/forums/.x (internal redirects of XF redirect to correct title)
3) example2.com/threads/.y (internal redirects of XF redirect to correct title)

So far, I've managed to do all of this with a few lines in my htaccess file:

Code:
<IfModule mod_rewrite.c>
  RewriteEngine On
 
## to redirect forums (forumdisplay using f=)
RewriteCond %{QUERY_STRING} ^f=([0-9]+)$
RewriteRule ^forumdisplay\.php$ http://example2.com/forums/.%1? [L,R=301]
 
## to redirect threads (showthread using t=)
RewriteCond %{QUERY_STRING} ^t=([0-9]+)$
RewriteRule ^showthread\.php$ http://example2.com/threads/.%1? [L,R=301]
 
## to redirect posts (showthread using p=)
RewriteCond %{QUERY_STRING} ^p=([0-9]+)$
RewriteRule ^showthread\.php$ http://example2.com/posts/.%1? [L,R=301]
</IfModule>

I'm keeping the main 1) example.com -> 1) example2.com/forum off until I can find other things that I havent redirected yet.... I thought the above htaccess might be of use to others doing the same thing
 
This is the complete redirect script I use when redirecting from

example1.com
to
examle2.com/forum

Code:
<IfModule mod_rewrite.c>
  RewriteEngine On
 
## to redirect forums (forumdisplay using f)
RewriteCond %{QUERY_STRING} ^f=([0-9]+)$
RewriteRule ^forumdisplay\.php$ http://example2.com/forums/.%1? [L,R=301]
 
## to redirect threads (showthread using t=)
RewriteCond %{QUERY_STRING} ^t=([0-9]+)$
RewriteRule ^showthread\.php$ http://example2.com/threads/.%1? [L,R=301]
 
## to redirect posts (showthread using p=)
RewriteCond %{QUERY_STRING} ^p=([0-9]+)$
RewriteRule ^showthread\.php$ http://example2.com/posts/.%1? [L,R=301]
 
## redirect just top level .com and .com/index.php
RewriteCond %{HTTP_HOST} example1\.com [NC]
RewriteCond %{REQUEST_URI} ^/$
Rewriterule ^(.*)$ http://example2.com/ [L,R=301]
RedirectMatch 301 ^/index\.php$ http://example2.com/forum/
</IfModule>

I've just written it, it seems to do the job... I hope it's of use to others that convert to XF and also change the domain name
(Let me known if it needs improving)
 
Top Bottom