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

Yet another .htaaccess thread. Odd behavoir, forum nodes not working.

Discussion in 'Server Configuration and Hosting' started by jamiew0w, Oct 3, 2014.

  1. jamiew0w

    jamiew0w Member

    So I've wrestled with this for a while and I'm beginning to feel like I'm getting nowhere.

    So, to start at the start.

    My forums aren't in root, they're in /forums so first up I have to redirect;
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
    RewriteCond %{REQUEST_URI} !^/forums/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /forums/$1
    RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
    RewriteRule ^(/)?$ forums/index.php [L]
    options -Indexes
    Note, in the ACP I have "board url" set to http://domain.com/forums and "homepage url" set to http://domain.com and index route is blank.
    This works fine, everything works and all the node links work.

    When I turn on Friendly URLs though, things get a little weird.

    Categories will load, but boards won't. Individual threads will still open. I've read in this thread that it was due to the Friendly URLs setting it to http://yourdomain.com/forum/forums/main-forum.2/ so I removed /forums from the Index Path in ACP. I thought this had it fixed as the links had changed to http://yourdomain.com/forums/main-forum.2/ but it's still throwing up the "error page not found".

    So now I'm really confused, the htaacess in forum root is default apart from uncommenting the " RewriteBase /forums" line.

    I assumed it was a misconfiguration in the ACP but I've tried variations and constantly come up with the "error page not found" when trying to view boards from the main node. If I turn off Friendly URLs they all work again instantly.

    I'm guessing it's something with my htaaccess in the root but I'm not sure what.
    NB: Friendly URLs ARE working, just not for forum links in the node, which is odd..?
    Last edited: Oct 3, 2014
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Why, if the installation is in /forums, do you have the board URL set to the domain root?
    That should be set to your actual installation path.

    Which site is this for?
    I have checked the site in your account and it is actually installed in the root as far as I can tell.
  3. jamiew0w

    jamiew0w Member

    Oh, you're right, Yeah I changed it back to /forums in the ACP after posting.

    I'm guessing it shows as installed in root because of the friendly URLs and the htaccess in the root.

    edit; It's for the site you see, I just don't want to post it public, still saving up for a few addons before sharing it here (notably your CTA portal)
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I'm not sure what it is you're trying to do.
    If you want it to appear in the root, why not just move it there, rather than use rewrites?
  5. jamiew0w

    jamiew0w Member

    I figured it'd be easier to keep it in /forums because I was planning on putting in a proper portal or landing page down the line.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    If it's a landing page or software such as WP which is external to XenForo then that makes sense.
    If it's a portal add-on however, that will be in the XenForo installation path so you would need XenForo to be in the root.

    Either way, you shouldn't really be manipulating routes unnecessarily like this.
    jamiew0w likes this.
  7. jamiew0w

    jamiew0w Member

    Hmm, I guess I'll move everything into the root then, sounds a lot easier. Thanks for your help!
  8. Brogan

    Brogan XenForo Moderator Staff Member

  9. jamiew0w

    jamiew0w Member

    Yeah, I've screwed about with xenporta in the past, I just remember it as being a complete headache trying to set the portal as landing page properly, probably because it was out of date or whatever. Maybe it was just me being slow.

    I've seen yours too, mentioned it a few posts up and it's very slick. Unfortunately it's a tad outta my price range atm.
  10. Brogan

    Brogan XenForo Moderator Staff Member

    Ah, I missed the edit.

    Good luck getting it sorted.

Share This Page