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

XF 1.5 Apache Rewrite Help

Discussion in 'XenForo Questions and Support' started by Da Bookie Mon, Feb 5, 2016.

  1. Da Bookie Mon

    Da Bookie Mon Well-Known Member

    One thing I never been good with is rewrites, so I need some sample help to get me started.

    I'd like to forward members profiles to https://members. So an example would be https://domain.com/members/mike-edge.8963 -> https://members.domain.com/mike-edge.8963

    I'd like to forward the main forum node to https://forums. So an example would be https://domain.com/forums/ -> https://forums.domain.com

    I'd like to forward our help forum to https://help. So an example would be https://domain.com/forums/community-help.3/ -> https://help.domain.com/

    I'd like to forward our wordpress to https://articles. So an example would be https://domain.com/wordpress/ -> https://articles.domain.com/

    Thanks in advance for the help!
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add these rules to the top of the .htaccess file in the web root (XF's .htaccess file):

    Code:
    RewriteEngine On
    
    RewriteRule ^members/(.*)$ https://members.domain.com/$1 [R=301,L]
    RewriteRule ^forums/$ https://forums.domain.com/ [R=301,L]
    RewriteRule ^forums/community-help\.3/(.*)$ https://help.domain.com/$1 [R=301,L]
    RewriteRule ^wordpress/(.*)$ https://articles.domain.com/$1 [R=301,L]
    
    There will be other considerations though, like parking the subdomains on the appropriate web roots, and possibly creating a XF addon to enforce proper generation of the new subdomain links for certain URLs and routes. This is likely to be a bit of work.
     
    Da Bookie Mon likes this.

Share This Page