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

XF 1.3 Privide me code htaccess to redirect old urls vb4 in search engine to new xf

Discussion in 'Installation, Upgrade, and Import Support' started by jamalfree, Feb 22, 2014.

  1. jamalfree

    jamalfree Active Member

  2. woei

    woei Well-Known Member

    jamalfree and lazy llama like this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add these rules to the top of the .htaccess file in your /forum directory:

    Code:
    RewriteEngine On
    
    RewriteRule ^threads/([0-9]+)-.*$ /threads/$1/ [R=301,L]
    RewriteRule ^forums/([0-9]+)-.*$ /forums/$1/ [R=301,L]
    
     
    jamalfree likes this.
  4. jamalfree

    jamalfree Active Member

    Tank you for all
    i try Jake Bunce the code look good but didnt work correctly
    for example
    http://localhost/xenforo/threads/33813-hello-world
    redirect to
    http://localhost/threads/33813/
    i wait some help
     
  5. Jeremy

    Jeremy XenForo Moderator Staff Member

    Change it from /threads/ to /xenforo/threads/$1/.
     
    jamalfree likes this.
  6. jamalfree

    jamalfree Active Member

    this code origine to xenforo, where i should put code bellow, i hope give to me code with right change
    tank you
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That is different than your previous example. The old directory name is /xenforo instead of /forum.

    In that case you need to add these rules to the top of the .htaccess file in your /xenforo directory:

    Code:
    RewriteEngine On
    
    RewriteRule ^threads/([0-9]+)-.*$ /threads/$1/ [R=301,L]
    RewriteRule ^forums/([0-9]+)-.*$ /forums/$1/ [R=301,L]
    
     
    jamalfree likes this.
  8. jamalfree

    jamalfree Active Member

  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    jamalfree likes this.
  10. jamalfree

    jamalfree Active Member

    i am very glad for your helpful replies
    thanks very much JACKE
     
  11. jamalfree

    jamalfree Active Member

    this last one
    showthread.php?t=2 to /forum/threads/$1/
    ;)
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add these rules to the top of the .htaccess file in your /forum directory:

    Code:
    RewriteEngine On
    
    RewriteCond %{QUERY_STRING} (^|\?)t=([0-9]+)(&|$)
    RewriteRule ^showthread\.php$ /forum/threads/%2/? [R=301,L]
    
     
    semprot and jamalfree like this.
  13. jamalfree

    jamalfree Active Member

    great job
    thanks
     

Share This Page