XF 1.3 tricky vbseo redirect bug

Tim Jay

Active member
Hi everyone, I have a funky redirect issue going on at the moment.

I just got done with the whole import and rebuilding process a couple hours ago. I have been messing with this for many many days now & just spent a lot of hours today (tonight completing this. Everything is working decently other than a few problematic link redirects.

I have been on vbulletin 3.8.x + vbseo for many years. I made the switch and complete the imported.

After the whole process, I then downloaded these
https://xenforo.com/community/resources/redirection-scripts-for-vbulletin-3-x.264/
edited 301config.php and used http://tools.geekpoint.net/xfseo/ where I uploaded my vbseo urls .xml.

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

I made the edits and my links are actually redirecting as intended.

http://example.net/threads/125575-thread-title-amazing/ redirects to
http://example.net/threads/thread-title-amazing.125575/ just fine

BUT, I seem to have a problem now with any threads that begin with numbers.

http://example.net/threads/61000-stellar-for-sale-135.282738/ redirects to
http://example.net/threads/game-find-earn-20-gc.61000/

http://example.net/threads/6-3-window-vps-super-cheap.281462/ redirects to
http://example.net/threads/website-updates.6/

Some titles are even redirecting to the front page. It seems to happen with threads beginning with numbers or symbols.

50% off hosting
http://example.net/threads/50-off-hosting-livetime-free-domain.282255/

$0.50 Domain name
http://example.net/threads/0-50-domain-name-hurry-up-limited-time-offer.274935/

0.0087 btc sold
http://example.net/threads/0-00871-btc-sold.282671/

So as you can see I'm in a bit of a pickle. I'd like to say everything else went perfectly so far, I'd just like to get this out of the way since some people can't access their marketplace threads.

Thanks in advance,
TJ
 
So it looks like valid XF URLs are being redirected?

I'd probably just put a catch rule at the top to snag URLs that contain a period and send them to the XF URL, then stop the processing. Something like:

RewriteRule ^threads/([\d]+).([\d])/ /threads/$2/ [NC,L,R=301]

Jake might come along in a minute and make me look dumb, but you could try that!
 
Come to think of it, you probably don't need the 301 in there since you're not actually redirecting an incorrect URL, just catching it before it hits the rest of your processing table.
 
Change the second rule to:

Code:
RewriteRule [^/]+/([\d]+)-[^.]+/ showthread.php?t=$1 [NC,L]

I think that should work. It's possible the "." needs to be "\."
 
Hey @Mike

I never realized, but my vb indexed subforums are not really redirecting. It's not as big of a deal as threads but I was wondering how difficult that might be to setup custom htaccess rules.

vbulletin subforum - http://website.com/introductions/
xenforo subforum - http://website.com/forums/introductions.4/

Someone gave me a query to run on vb db and I was able to grab all the proper forum ids.

Redirect 301 lobby http://website.com/forumdisplay.php?f=1
Redirect 301 announcements http://website.com/forumdisplay.php?f=2
Redirect 301 our-community http://website.com/forumdisplay.php?f=3

Any chance you could give me a hand?
 
I have a website powered by vBSEO and vBulletin 3... I set a custom URLs which are :

Threads : domain.com/post/POST_ID/
Forums : domain.com/f FORUM_ID

would you please give me rewrite rules which I should use in my .htaceess ?

Thank you
 
I have a website powered by vBSEO and vBulletin 3... I set a custom URLs which are :

Threads : domain.com/post/POST_ID/
Forums : domain.com/f FORUM_ID

would you please give me rewrite rules which I should use in my .htaceess ?

Thank you

I can give you rewrite rules, but I prefer to work with real examples for certainty. Can you provide a real old and new thread URL.
 
Thank you for your response Jake !

I didn't provide the actual URLs since it belongs to one of my customers .. ok here are the actual URLs :

Code:
http:// xboxworld.us/post/1151/
http:// xboxworld.us/f7/

Thank you again !
 
Thank you for your response Jake !

I didn't provide the actual URLs since it belongs to one of my customers .. ok here are the actual URLs :

Code:
http:// xboxworld.us/post/1151/
http:// xboxworld.us/f7/

Thank you again !

Can I get the equivalent new URLs in XF as well? Both old and new URLs are needed to provide exact instructions.
 
Thank you for your response Jake !

I didn't provide the actual URLs since it belongs to one of my customers .. ok here are the actual URLs :

Code:
http:// xboxworld.us/post/1151/
http:// xboxworld.us/f7/

Thank you again !

Assuming XF is installed at http:// xboxworld.us/ (where vB used to be), and assuming the ids are the same... add these rules to the .htaccess file in your web root (which should be XF's .htaccess file):

Code:
RewriteEngine On

RewriteRule ^post/([0-9]+)/$ /posts/$1/ [R=301]
RewriteRule ^f([0-9]+)/$ /forums/$1/ [R=301,L]
 
Thank you very much Jake

Well I will test these rules as soon as I finish converting his vb to xf ...

I have another question please .. is it possible to replace keywords in URLs with IDs ?

For instance change this URL : " xenforo. com/community/threads/tricky-vbseo-redirect-bug.82175 " ==>> to ==>> " xenforo. com/community/threads/82175 "

Thank you again.
 
Top Bottom