XF 1.5 Redirecting URL Issue


New member
Hello All,

Please be easy on me I am a newbie :-/

I recently purchased and installed xenforo in a cakephp environment. The install location for the forum is domain-name/app/webroot/forums/ I want it so that the url path is domain-name/forums/ but when I go there it redirects me to domain-name/app/webroot/forums/.

I am reading that something should be done via mod_rewrite and htaccess file in the forum install dir, so that any hit to domain-name/app/webroot/forums/ would rewrite to domain-name/forums/, i have been researching and trying to figure this out for hours without any luck. Anyone have suggestions for me?

Thanks in advance.
Is domain-name/app/webroot/ actually defined as the web root in your web server config (I assume Apache based on your mod_rewrite comments)? If not, what is and how are you (presumably) making domain-name/app/webroot/ be the root?
@Mike thanks for the response.

webroot is defined as root directory in cakephp.

define('ROOT', dirname(__FILE__));
define('WEBROOT_DIR', 'webroot');

the main site will run from webroot, and i want the forum to run from /forums. the problem is when you go to /forums it redirects to domain-name/app/webroot/forums/
Am I correct in thinking that the code you've shown is inside the domain-name directory?

Is there an .htaccess file in that directory?
yes, there are two .htaccess files, one in the webroot directory, and one in the forums directory (where i installed xenforo)

i have tried a # of combinations in .htaccess using mod_rewrite but none have worked so far, the most recent one I tried is:

RewriteRule ^forums$ /app/webroot/forums/ [L]

also, i am not sure if i put that in the .htaccess in the root or in the forums folder.
So if domain-name/ is your web root in the traditional meaning, is there any reason not to just make domain-name/forums/? XF is entirely separate from your CakePHP app, so it doesn't necessarily make sense to put it within that.
Top Bottom