XF 1.2 Rewrite rule after moving Xenforo to root

Martok

Well-known member
I'm looking at moving my installation to the root. It is currently in /community/.

I know how to do the move and the change in the ACP. What I'm not sure on is the rewrite rules I need so that anyone who uses an old URL with /community/ in it will end up at the correct location.

Sorry if this has been asked before but I couldn't find the answer.
 
I'm looking at moving my installation to the root. It is currently in /community/.

I know how to do the move and the change in the ACP. What I'm not sure on is the rewrite rules I need so that anyone who uses an old URL with /community/ in it will end up at the correct location.

Sorry if this has been asked before but I couldn't find the answer.

Offhand, this seems to work:

Code:
RewriteRule community$ / [R=301]
RewriteRule community/(.*)$ $1 [R=301]

Add that just under the first <ifmodule mod_rewrite> tag :)
 
Add to the top of the .htaccess file in the old /community directory:

Code:
RewriteEngine On

RewriteRule ^(.*)$ /$1 [R=301,L]

Or if you wish to delete the old directory then add this to the top of the .htaccess in the web root:

Code:
RewriteEngine On

RewriteRule ^community/(.*)$ /$1 [R=301,L]
 
Back
Top Bottom