htaccess rewrite rules

Discussion in 'XenForo' started by Jim McClain, May 19, 2017.

  1. Jim McClain

    Jim McClain Senior Citizen

    This is a duplicate of a post I made on xenForo, but I realize some htaccess wizards may not visit that site often.

    I would like to create some redirects to new URLs when I convert my forum from vB 3.8 and vBSEO to xenForo 1.5 that will minimize any loss of backlinks. Here is a list of example URLs currently used on my vB forum:

    Forum root installation: /community/
    Forum category: /community/#category-name/ (it does not go to a separate page, but automatically scrolls to the category)
    Forum name: /community/carpet-q-and-a/ (this is accomplished the same way using the optional URL Portion in the node tree)
    Thread name: /community/carpet-q-and-a/20776-need-help-with-new-carpet.html (I understand xF doesn't use the forum name or the .html extension in the URL, so I need to redirect that to /community/thread/20776-need-help-with-new-carpet/)
    Thread name with additional pages: /community/carpet-q-and-a/20776-need-help-with-new-carpet-2.html (note the -2 added to the thread title - so I would have to redirect that in a similar fashion to the previous rule, or just redirect to the first page of a multi-page thread)

    Can you help me out with some example htaccess rules? Would I need a separate rule for threads in each specific forum? Will it be possible to create URLs that use the thread ID at the beginning of the thread slug and with a dash instead of a dot?

    Thanks for any help you can provide.
  2. Maddox

    Maddox Moderator

    I would suggest you visit

    That will generate a redirect system for you then if you want additional redirects you could just copy a paste using the generated file as a resource.

    It's a useful system to get to grips with the syntax that you need.

    Hope that helps you

  3. Jim McClain

    Jim McClain Senior Citizen

    As far as I can tell, that will create redirects for specific pages, but not for dynamically created pages like you find on forums - those that use thread ID numbers, page numbers and the odd (to me) code used like wildcards so you don't have to write individual 301s for every thread and thread page you have. Am I missing something?
  4. Digital Doctor

    Digital Doctor Tazmanian

    Post on - jake bunce is the master.
  5. ozzy47

    ozzy47 Tazmanian Veteran

  6. Jim McClain

    Jim McClain Senior Citizen

    No reply from JakeJake yet.
    Last edited: May 19, 2017
  7. mysiteguy

    mysiteguy Devotee

    Depending on the VB SEO setup you have, rewrite rules may not cover it all. I've had to write PHP code which does redirects for certain types of VB SEO setups in these cases. Good luck with it. :)
  8. CarpCharacin

    CarpCharacin Habitué

  9. Jim McClain

    Jim McClain Senior Citizen

    I've got it all worked out already. Thank you.
Draft saved Draft deleted
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.