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

XF 1.5 DBSEO URL rewrite

Discussion in 'Installation, Upgrade, and Import Support' started by Sperber, Oct 9, 2015.

  1. Sperber

    Sperber Active Member

    Hey there,

    we´re just about to launch our forums and imported vBulletin 4 into xf. Now comes the part where the url redirects come into the game and that won´t work atm. I don´t understand url rewriting and hope that may be someone who is more capable of could gimme a helping hand on this.

    Our vb URL structure was:
    Threads: domain.name/[ID]-stripped-thread-titel.html
    Categories: domain.name/category-name/
    Forums: domain.name/forums/

    Would be really glad if someone could help me out here.
    Thanks,
    Sperber
     
  2. Mouth

    Mouth Well-Known Member

  3. Sperber

    Sperber Active Member

    Hello Mouth,

    already seen this one but as far as I understand it by description, this mod only is for standard or vbSEOed Urls - not for the ones DBSEO has generated. Or am I wrong?
     
  4. Mouth

    Mouth Well-Known Member

    Probably best to ask in it's discussion thread.
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Without ids the categories and forums will require extra effort. But the threads are easy.

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

    Code:
    RewriteEngine On
    
    RewriteRule ^([0-9]+)-[^\./]+\.html$ /threads/$1/ [R=301,L]
    
    This assumes that the ids are the same and XF is installed in the web root where vB was.
     
  6. Sperber

    Sperber Active Member

    Hi @Jake Bunce ,

    great news thanks. But unfortunal I´ve given incorrect settings of the rewrite-structure. Sorry, my bad.
    The thread links are indeed domain.name/forumnamewithoutID/[ID]-thread-title.html .

    Someone here told me that would be absolutly doable, but requires a rule for each forum. Would you mind to show me how I can do this with an example rule?

    Thanks again,
    Sperber.
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add these rules 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 handle all such URLs no matter what the forum slug is.
     
  8. Sperber

    Sperber Active Member

    You rock, Jake :D Thanks a lot!
     

Share This Page