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

XF 1.2 Rewrite rule help. Change of domain

Discussion in 'Installation, Upgrade, and Import Support' started by woei, Mar 6, 2014.

  1. woei

    woei Well-Known Member


    I'm wondering how I make the correct rewrite rule for vBulletin 4.2.2. with advanced friendly urls enabled to XenForo.

    Example old url:

    Example new url (domain changed from forum.scooterforum.net to scooterforum.net)

    What do I need for successful rewriting of the urls? And more important, where do I need to put the .htacces file? Only in the forum.scooterforum.net root right? There would be the only place the rewrite is needed?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add these rules to the top of the .htaccess file in forum.scooterforum.net/forum:

    RewriteEngine On
    RewriteRule ^showthread\.php/([0-9]+)-.*$ http://scooterforum.net/threads/$1/ [R=301,L]
  3. woei

    woei Well-Known Member

    Thanks. With my rewrite script below I don't need to upload the vb4 rewrite script right?

    And is this correct code for rewriting everything that I need for vb 4? threads/posts/forums/attachments/archive/member/ links?
    RewriteEngine On
    RewriteRule archive/index\.php/t-([0-9]+)\.html$ http://scooterforum.net/threads/$1 [R=301,L]
    RewriteCond %{QUERY_STRING} attachmentid=([0-9]+)(&|$)
    RewriteRule attachment\.php$ http://scooterforum.net/attachments/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} f=([0-9]+)(&|$)
    RewriteRule forumdisplay\.php$ http://scooterforum.net/forums/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} u=([0-9]+)(&|$)
    RewriteRule member\.php$ http://scooterforum.net/members/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
    RewriteRule printthread\.php$ http://scooterforum.net/threads/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} p=([0-9]+)(&|$)
    RewriteRule showpost\.php$ http://scooterforum.net/posts/%1? [R=301,L]
    RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Looks good to me. Those rules will handle the default non-friendly URLs (e.g. forumdisplay.php?f=#)

Share This Page