XF 1.3 Redirects after moving xenforo from directory to root

Mr Lucky

Well-known member
I am thinking of moving my xenforo installation from a subdirectory into the root.

Currently the root has redirect scripts from my prvious vbulletin installation, and I think this is straightforward to change in the 301config.php

Or do I just remove the 301config.php altogether and keep showthread.php etc.

BUT

I also want to redirect from the previous xenforo so that want was e.g. domain.com/community/forums goes to domain.com/forums

My concern here is getting a redirect that doesn't conflict with the vbulletin redirects.
 
Add these rules to the top of the .htaccess file in your /community directory:

Code:
RewriteEngine On

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

The vB redirect scripts should be fine remaining in the web root.
 
Thanks Jake, that worked.

Amazing, I searched Google on redirecting directory to root, tried the first 6 and none of them worked.

What a nice forum this is.

Also I had to remember to comment out the path to the directory in 301config.php of course.
 
I do not have a /community directory. My problem is this: I had Wordpress with a bridge in my root directory. I recently decided to go with 8WayRun's Xenporta2, and I copied my forums directory contents into the root (in my case, the XF forums directory is /gforums. I wanted to delete the /gforums directory and change the Board Information URL to my site URL. That did not work, even though I could easily access my Admin panel. As of now, I have both the root and the /gforums directory because without the /gforums directory the forums do not show and my users get 500 INTERNAL SERVER ERROR. How do I add the rewrite and have only the ONE directory?
 
Last edited:
What do you have entered here:

Admin CP -> Options -> Basic Board Information -> Index Page Route

Right now, it says /articles because I want Xenporta2's articles page to show first (and it does). The site is GateFans Forums and when you click the Forums link, it goes to GateFans Forums, even though there is no /forums directory. The original XF install is in gforums, but a copy of the contents of /gforums is in the root now as well. Naturally, that is causing issues. If one goes to a thread in the root and uploads a file, it ends up in the /data/attachments folder instead of /gforums/data/attachments. Stuff like that. Thumbnail generation has gone wonky as well.
 
Right now, it says /articles because I want Xenporta2's articles page to show first (and it does). The site is GateFans Forums and when you click the Forums link, it goes to GateFans Forums, even though there is no /forums directory. The original XF install is in gforums, but a copy of the contents of /gforums is in the root now as well. Naturally, that is causing issues. If one goes to a thread in the root and uploads a file, it ends up in the /data/attachments folder instead of /gforums/data/attachments. Stuff like that. Thumbnail generation has gone wonky as well.

Remove the /gforums directory. Then add these rules to the top of the .htaccess file in your web root directory:

Code:
RewriteEngine On

RewriteRule ^gforums/(.*)$ /$1 [R=301,L]
 
Remove the /gforums directory. Then add these rules to the top of the .htaccess file in your web root directory:

Code:
RewriteEngine On

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

This did not work for me. The board kept returning to the Articles page for Xenporta2 and I could not access the forums. Restoring the /gforums directory fixed it. I am having issues with thumbnail generation too. Only when I upload things in the /gforums directory will the thumbnails generate.
 
I am thinking of moving my xenforo installation from a subdirectory into the root.

Currently the root has redirect scripts from my prvious vbulletin installation, and I think this is straightforward to change in the 301config.php

Or do I just remove the 301config.php altogether and keep showthread.php etc.

BUT

I also want to redirect from the previous xenforo so that want was e.g. domain.com/community/forums goes to domain.com/forums

My concern here is getting a redirect that doesn't conflict with the vbulletin redirects.
Hi Mr Lucky, I have planned to move my XF to the root as you did. My question is, did you just move XF through the FTP just by drag-and-drop or did you do something special about it?
 
From old VB resides on /forums/
Now XenForo use root folder.
This codes works for me.
Code:
        RewriteRule ^forums/attachment.php(.*)?$ /attachment.php$1 [R=301,L]
        RewriteRule ^forums/forumdisplay.php(.*)?$ /forumdisplay.php$1 [R=301,L]
        RewriteRule ^forums/member.php(.*)?$ /member.php$1 [R=301,L]
        RewriteRule ^forums/printthread.php(.*)?$ /printthread.php$1 [R=301,L]
        RewriteRule ^forums/showpost.php(.*)?$ /showpost.php$1 [R=301,L]
        RewriteRule ^forums/showthread.php(.*)?$ /showthread.php$1 [R=301,L]
 
Back
Top Bottom