• 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

Mike Edge

Well-known member
#1
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!
 

Jake Bunce

XenForo moderator
Staff member
#2
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.