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

mod_rewrite help

sifuhall

Active member
#1
Currently my xenforo is installed in the document root folder and I would like to move it to a subfolder (like community) without breaking any existing links.

Is it possible with .htaccess and mod_rewrite to redirect all my forum traffic (like forums, pages, etc) to /community while leaving traffic to my document root alone (traffic to /)?
 

sifuhall

Active member
#2
After much trial and error it looks like this works pretty well:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(forum|threads|pages|events|media|members)/(.*)$ /community/$1/$2 [NC,L,R=301]