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

XF 1.5 Redirecting URL Issue

Discussion in 'Installation, Upgrade, and Import Support' started by markjd, Jul 13, 2016.

  1. markjd

    markjd 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.
     
  2. Mike

    Mike XenForo Developer Staff Member

    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?
     
  3. markjd

    markjd New Member

    @Mike thanks for the response.

    webroot is defined as root directory in cakephp.

    define('ROOT', dirname(__FILE__));
    define('WEBROOT_DIR', 'webroot');
    define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);

    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/
     
  4. Mike

    Mike XenForo Developer Staff Member

    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?
     
  5. markjd

    markjd New Member

    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.
     
  6. Mike

    Mike XenForo Developer Staff Member

    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.
     

Share This Page