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

XF 1.2 Imported - Kept IDs - why script for redirect?

Discussion in 'Installation, Upgrade, and Import Support' started by Kurt, Dec 14, 2013.

  1. Kurt

    Kurt Member

  2. Mike

    Mike XenForo Developer Staff Member

    You can write direct mod_rewrite adjustments if you prefer. In general, the scripts are just simpler if you don't have experience writing mod_rewrite directives.
     
  3. Kurt

    Kurt Member

    This sends VBSEO links to old VB links
    RewriteRule ^[^/]+/([0-9]+)-[^\.]+\.html$ /forums/showthread.php?t=$1 [L,R=301]

    Now how do I forward VB 3.8.7 links to the Xenforo SEO links? Or can I even use the two Rewrites together like that?

    My main concern is performance. Mod Rewrite is less load than the script with import log in DB, right?
    There's dozens of threads about redirects but they all include people using the scripts. @Jake Bunce is in there a lot helping folks.
    Can y'all post a thread on how to use Mod Rewrite when your post ID's stay the same? No scripts required.

     
  4. Slavik

    Slavik XenForo Moderator Staff Member

    These forward normal vb urls to xenforo

    Code:
    RewriteEngine On
    RewriteCond %{QUERY_STRING} attachmentid=([0-9]+)(&|$)
    RewriteRule attachment\.php$ http://yoursite.com/attachments/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} f=([0-9]+)(&|$)
    RewriteRule forumdisplay\.php$ http://yoursite.com/forums/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} u=([0-9]+)(&|$)
    RewriteRule member\.php$ http://yoursite.com/members/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
    RewriteRule printthread\.php$ http://yoursite.com/threads/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} p=([0-9]+)(&|$)
    RewriteRule showpost\.php$ http://yoursite.com/posts/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
    RewriteRule showthread\.php$ http://yoursite.com/threads/%1? [R=301,L]
    RewriteRule archive/index\.php/t-([0-9]+)\.html$ http://yoursite.com/threads/$1 [R=301,L]
    RewriteRule archive/index\.php/f-([0-9]+)\.html$ http://yoursite.com/forums/$1 [R=301,L]
    
     
    Peace, Kurt and Jake Bunce like this.
  5. Kurt

    Kurt Member

    Works perfect, thanks!
     

Share This Page