Implications of running xenforo from a subdirectory (ie. /community or /forums )

Digital Doctor

Well-known member
Information is Power.
Help the newbies !

Could the mods/devs/everyone please use this thread to detail the implications of installing xenforo in subdirectory ? (as opposed to installing it in the root directory).

Information and Implications of installing Xenforo in a subdirectory

(1) Don't install to /forums subdirectory ?
If you do ... your site will have urls like www.mysite.com/fourms/forums - [source]
Note: It appears that xenforo.com itself installed xenforo in a subdirectory called /community

(2) URLs in Xenforo.
When your users are on a page or forum or thread, xenforo adds that to the URL.
/forum - when in a forum
/thread - when reading a thread
/pages - when on a page Q: What is a "Page" ?
/post - when posting

/members - member's Tab
/help - Help Tab
/account - Account Preferences - http://xenforo.com/community/account/preferences
/watched - watched threads - http://xenforo.com/community/watched/threads
/search - Search - http://xenforo.com/community/search/?type=post

Takehome message: Most people should install xenforo in a subdirectory called /community - just like xenforo.com did.

(3) If you want other software installed (Wordpress, a CMS, etc.) on your site, you should install xenforo to a subdirectory.
- this avoids clashes with other software's index.php :) [source]

(4) It might help with /mod rewrites ? (researching this).

How to move your xenforo install from the root directory to a subdirectory

There's very little work involved moving the forum to a sub-directory.
Just move the files and update the URL in the ACP and that's it.
Pretty easy ! Also discussed here.
 
This has been discussed before but essentially, if you plan to install any other software such as a CMS, or even have a home page, you will not be able to have 2 index.php (or admin.php) files in the root.
For that reason, your forum will have to be in a sub-directory.

I'll see if I can locate the earlier thread which discussed this.
 
if you plan to install any other software such as a CMS, or even have a home page, you will not be able to have 2 index.php files in the root. For that reason, your forum will have to be in a sub-directory.
Putting that in the Xenforo installation instructions could help save some future headaches. Is it in there already ?
 
This is not something that's unique to XenForo.
It applies to any software which has an index.php, or files with the same name as other software which could be installed.
 
Do you have a file called .htaccess in the root directory ?
I assume you are on an apache web server ?

heh.
I see you are.

Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_fcgid/2.3.6 Server at ueg-immunity.com Port 80
 
#Mod_security can interfere with uploading of content such as attachments. If you
#cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#SecFilterEngine Off
#SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

<IfModule mod_rewrite.c>
RewriteEngine On

#If you are having problems with the rewrite rules, remove the "#" from the
#line that begins "RewriteBase" below. You will also have to change the path
#of the rewrite to reflect the path to your XenForo installation.
#RewriteBase /xenforo

#This line may be needed to enable WebDAV editing with PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
 
Top Bottom