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

XF 1.2 SMF redirect to xF

Discussion in 'Installation, Upgrade, and Import Support' started by Skylined, Jan 28, 2014.

  1. Skylined

    Skylined Active Member

    Could somebody please help me to redirect from SMF to xF?

    Sample

    Code:
    SMF - http://www.mtb.com.uy/foro/index.php?topic=5234.0
    xF - http://www.mtb.com.uy/foro/temas/asiento-antiprostatico-%C2%BFes-necesario.5234/
    Temas is spanish for threads. :)
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Code:
    RewriteRule ^index.php\?topic=([\d])*(.)*$ temas/$1 [R=301,L]
    
    Try that.
     
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add to the top of the .htaccess file in the /foro directory:

    Code:
    RewriteEngine On
    
    RewriteCond %{QUERY_STRING} (^|\?)topic=([0-9]+)\.
    RewriteRule ^index\.php$ /foro/temas/%2/? [R=301,L]
    
     
    Jeremy likes this.
  4. Skylined

    Skylined Active Member

    Thank you @Jake Bunce, it worked! :)

    There's one more that needs to be converted.
    It's the same as above but with .html at the end.

    Code:
    http://www.mtb.com.uy/foro/index.php/topic,1014.0.html
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Amendment to previous rules to include the new URL:

    Code:
    RewriteEngine On
    
    RewriteCond %{QUERY_STRING} (^|\?)topic=([0-9]+)\.
    RewriteRule ^index\.php$ /foro/temas/%2/? [R=301,L]
    
    RewriteRule ^index\.php/topic,([0-9]+)\. /foro/temas/$1/ [R=301,L]
    
     
    Skylined likes this.
  6. Skylined

    Skylined Active Member

    Thanks! :)

    I'll keep an eye on Google's Webmaster Tools to see if there's anything else that has to be fixed.
     
  7. Skylined

    Skylined Active Member

    Found some more, this ones are linked to a specific post in a thread.

    From
    Code:
    http://www.mtb.com.uy/foro/index.php/topic,2354.msg29258.html
    

    To
    Code:
    http://www.mtb.com.uy/foro/temas/resultados-de-%E2%80%9Cgran-premio-orestes-carballo%E2%80%9D.2354/#post-29258
    
     
  8. Jeremy

    Jeremy XenForo Moderator Staff Member

    Code:
    RewriteEngine On
    
    RewriteCond %{QUERY_STRING} (^|\?)topic=([0-9]+)\.
    RewriteRule ^index\.php$ /foro/temas/%2/? [R=301,L]
    
    RewriteRule ^index\.php/topic,([0-9]+)\. /foro/temas/$1/ [R=301,L]
    RewriteRule ^index\.php/topic,([0-9]+)\.msg([0-9]+)\. /foro/posts/$2/ [R=301,L]
    Amend with that and it should work.
     
  9. Skylined

    Skylined Active Member

    Thanks Jeremy. :)

    That took me to the thread, but not straight to the message.
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    That should have taken you directly to the message as well. What was the final ending URL from that redirect?
     
  11. Skylined

    Skylined Active Member

    I ended up here.

    Code:
    http://www.mtb.com.uy/foro/temas/resultados-de-%E2%80%9Cgran-premio-orestes-carballo%E2%80%9D.2354/
     
  12. Mike

    Mike XenForo Developer Staff Member

    Code:
    RewriteRule ^index\.php/topic,([0-9]+)\. /foro/temas/$1/ [R=301,L]
    RewriteRule ^index\.php/topic,([0-9]+)\.msg([0-9]+)\. /foro/posts/$2/ [R=301,L]
    Flip the order around -- the "msg" one needs to go first as the general thread one matches both.
     
    Jeremy likes this.
  13. Skylined

    Skylined Active Member

  14. Skylined

    Skylined Active Member

    Found more.

    Before
    Code:
    http://www.mtb.com.uy/foro/index.php/board,5.0.html
    After
    Code:
    http://www.mtb.com.uy/foro/foro/carreras.5/
     
  15. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add to top of .htaccess file in /foro directory:

    Code:
    RewriteEngine On
    
    RewriteRule ^index\.php/board,([0-9]+)\. /foro/foro/$1/ [R=301,L]
    
     
    Skylined likes this.
  16. Skylined

    Skylined Active Member

    Thanks! :)
     
  17. Skylined

    Skylined Active Member

    Uruguay is moving from second level domains to first level domains (.com.uy to just .uy).


    I would like to change two things:
    1. Move from mtb.com.uy to just mtb.uy
    2. Move my forum from mtb.uy/foro to the root of mtb.uy

    Could you guys please help me with this redirection?
     
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    @Skylined

    That is all doable with one exception. When you move from /foro to / that will cause your current "foro" route to interfere with any redirects that we setup for the old /foro directory. Ideally you will need to change the name of your "foro" route to something else after the move, otherwise you won't be able to redirect traffic from /foro to /.
     
  19. Skylined

    Skylined Active Member

    Thanks @Jake Bunce. :)

    So what would I have to do if I name the route as "foros"?
     
  20. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Move the XF files to your web root and update this setting:

    Admin CP -> Home -> Options -> Basic Board Information -> Board URL

    Delete the old /foro directory.

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

    Code:
    RewriteEngine On
    
    # enforce new domain, mtb.uy
    RewriteCond %{HTTP_HOST} !^mtb\.uy$
    RewriteRule ^(.*)$ http://mtb.uy/$1 [R=301,L]
    
    # redirect old /foro directory to web root
    RewriteRule ^foro/(.*)$ /$1 [R=301,L]
    
     

Share This Page