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

XF 1.5 SMF Link Convertion?

Discussion in 'Installation, Upgrade, and Import Support' started by istanbulzoom, Aug 18, 2015.

  1. istanbulzoom

    istanbulzoom Member

    Hello,

    How can I convert SMF links;
    domain.com/index.php?topic=94212

    to XF links;
    domain.com/topic/example-topic.94212


    Thank you so much for your help...
     
  2. 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
    
    RewriteCond %{QUERY_STRING} (^|\?)topic=([0-9]+)($|&)
    RewriteRule ^index\.php$ /topic/%2/? [R=301,L]
    
     
  3. istanbulzoom

    istanbulzoom Member

    Hi Jake!

    Old smf links;
    gezenbilir.com/index.php?topic=97905

    New xf links;
    gezenbilir.com/konu/dag-kazalari.97905

    And after your codes;
    gezenbilir.com/topic/97905

    Do you have any recommendation?

    Regards
     
  4. istanbulzoom

    istanbulzoom Member

    Hi again,

    I found the problem.

    Regular smf links are like this;
    gezenbilir.com/index.php?topic=97905.0

    And second pages;
    gezenbilir.com/index.php?topic=97905.10

    Third pages;
    gezenbilir.com/index.php?topic=97905.20

    If I write the old smf links without .0 all they are working fine and opening the new xf links. But if I click an old smf link with .0 or .10 its opening to gezenbilir.com/topic/97905 wrong link.

    Any idea? :)
     
  5. 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
    
    RewriteCond %{QUERY_STRING} (^|\?)topic=([0-9]+)(\.[0-9]+)?($|&)
    RewriteRule ^index\.php$ /konu/%2/? [R=301,L]
    
    That should allow both types of links to work. And the above rules have been updated to redirect to the /konu route instead of /topic like you originally stated.
     
  6. istanbulzoom

    istanbulzoom Member

    Perfect! Thank you so much...
     

Share This Page