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

XF 1.3 tricky vbseo redirect bug

Discussion in 'Installation, Upgrade, and Import Support' started by Tim Jay, Sep 1, 2014.

  1. Tim Jay

    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
    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/6-3-window-vps-super-cheap.281462/ redirects to

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

    50% off hosting

    $0.50 Domain name

    0.0087 btc sold

    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,
  2. Ridemonkey

    Ridemonkey Well-Known Member

    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!
    Tim Jay likes this.
  3. Ridemonkey

    Ridemonkey Well-Known Member

    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.
    Tim Jay likes this.
  4. Mike

    Mike XenForo Developer Staff Member

    Change the second rule to:

    RewriteRule [^/]+/([\d]+)-[^.]+/ showthread.php?t=$1 [NC,L]
    I think that should work. It's possible the "." needs to be "\."
    Tim Jay likes this.
  5. Tim Jay

    Tim Jay Active Member

    That worked perfectly, thank you so much. The support for xenforo is so amazing.
  6. Tim Jay

    Tim Jay Active Member

    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?
  7. Mike

    Mike XenForo Developer Staff Member

    Tim Jay likes this.
  8. A.Chakery

    A.Chakery Active Member

    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
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
  10. A.Chakery

    A.Chakery Active Member

    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 :

    http:// xboxworld.us/post/1151/
    http:// xboxworld.us/f7/
    Thank you again !
  11. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Can I get the equivalent new URLs in XF as well? Both old and new URLs are needed to provide exact instructions.
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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):

    RewriteEngine On
    RewriteRule ^post/([0-9]+)/$ /posts/$1/ [R=301]
    RewriteRule ^f([0-9]+)/$ /forums/$1/ [R=301,L]
  13. A.Chakery

    A.Chakery Active Member

    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.
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Home -> Options -> Search Engine Optimisation (SEO) -> Include Content Title in URLs

Share This Page