MyBB Community Forums

Full Version: Wordpress .htaccess messing with forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Follow up to this thread: Not having 404 Error

Basically my forum is unable to give 404 errors, instead of giving 404 error it just redirects to mainpage again. After some testing I found out that it's caused by .htaccess file in root (Wordpress site), when I change name of that file to 1htaccess my forum works as it should and gives 404 errors when it should.

I am using Google SEO plugin, when I make any changes on forum's .htaccess file (except changing rewrite engine on to rewrite engine off which breaks everything) issue doesn't get fixed and some changes cause Google SEO plugin or any other redirects not working properly. But when I change name of .htaccess in root it works so at this point I am almost sure it's caused by that.

The thing is I never touched .htaccess file in root, so while I know what those stuff are in forum's htaccess, I basically have no idea what I have and what they do in Wordpress's htaccess and because of that I am scared to change or remove them thinking it might be something very important.

Any idea what might be causing this issue?
does it have rules like below
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
you have to add one more condition to above
- which instructs to not redirect when request is from your forum folder

I do not have exact code used for such requirement
in general, I try using something like RewriteCond %{IS_SUBREQ} false
Yes I have those rules.

I added that but didn't help.
can we have your forum url ..
------
If you have forum in a subdir, you have to add RewriteCond to wordpress rule so it will ignore the subdir urls.

If you search for wordpress rewrite exclude subdirectory or such things, you will find some hints.

https://stackoverflow.com/a/2350305/2876682

I'm not sure if that is still the correct solution but it should be something like it.



If your forum is on a different subdomain than your wordpress, they should not clash one another. WordPress should never appear on a subdomain it was not even installed on. Unless the subdomain itself was implemented using some weird rewrites in the first place (i.e. not a real subdomain). It's difficult without knowing more about the webserver configuration and you might just have to trial & error until you find something that works.

In this case you can probably also RewriteCond the host name itself.



Also this type of setup usually requires setting RewriteBase everywhere.
It's both forum.website.com and website.com/forum (but that redirects)

Directory is under root, forum folder. I think that's why it's interfering, thinking like it's part of Wordpress site but it's not.
Are you using caching plugin or SEO plugin in Wordpress ?
Their rules will cause issues.

Anyways add this in first line of .htaccess of your forum
RewriteEngine off
RewriteEngine on