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

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;
Code:
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:
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.
 
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)
 
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?
 
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?

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.
 
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.
 
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.
 
Back
Top Bottom