Support Forum

Persistent 404 errors when clicking on forum links in forum and in emails

AL a_creative_life
a_creative_life
Member

I continue to get this persistent, but sporadic problem. Clicking to reply to a forum post, or read a topic, or clicking on a link inside an email frequently (but not always) leads to a 404 page.

Help! 

Thanks,

Melissa

http://creativeignitionclub.com

this is a private membership site, so you will not be able to access the forums without a login! I will DM admin login details

20 Answers

New Answer

MP Mr Papa
Mr Papa
Member

does it fix itself?  or do you reset the forum permalink?

AL a_creative_life
a_creative_life
Member

The first time this happened I posted here and was told to reset the forum permalink, which seemed to fix the problem. However, I’ve now reset the forum permalink about 25 times, and the problem keeps persisting. I don’t even know if resetting the permalink even fixes it at all anymore.

MP Mr Papa
Mr Papa
Member

so the kicker here is that something on your site, likely another plugin is improperly flushing wp rewrite rules…  so when they flush them, they are not notifying other plugins so they can add theirs back in… if using the wp api, this is all automatic…

there is a handful of other users with similar issue but we have not found a common denominator or plugin yet…

you can try the change here:  https://simple-press.com/support-forum/sp5-general-topics/404-errors-1/page-2/#p124646

its worked for some, but not all…  we are still trying to get to the bottom of who or what is dumping the wp rewrite rules…  if that fails, we can give you some more code to use that should fix it but its a big hammer approach…

AL a_creative_life
a_creative_life
Member

Hi again,

I tried adding # before this line in simple-press/sp-startup/sp-load-site.php:

add_action(‘template_redirect’, ‘sp_404’);

 

And now I can’t even access ANY posts in the forum — no matter where I click it leads to a 404 page. 

:(
AL a_creative_life
a_creative_life
Member

I then tried removing that line of code — same problem:  I can ONLY get a 404 page.

I then replaced the line of code, without the # sign, and I can access my forum posts again (thank goodness).

I still have intermittent 404 problems…

YS Yellow Swordfish
Yellow Swordfish
Member

Your experience here might be telling and, with luck, may well back up a theory I have about this.

Would you be willing to try out two other, quite small, code edits?

AL a_creative_life
a_creative_life
Member

Sure–what are the edits?

Melissa

— Thumbed on my iPhone.

Melissa Dinwiddie Artist & Creativity Instigator Living A Creative Life http://melissadinwiddie.com

On Jul 11, 2013, at 1:06 AM, “Simple:Press Support” wrote:

> >

YS Yellow Swordfish
Yellow Swordfish
Member

To test this you will need to keep that ‘add_action’ – sp_404() routine discussed above removed or commented out. To make the further changes you need two files. They are both in the /sp-startup/ folder and are (1) sp-load-site.php and (2) sp-load-core.php.

In the first file locate these lines:

# Rewrite Rules
add_filter('page_rewrite_rules', 'sp_set_rewrite_rules');

and comment out the second line. But make a copy of it as we are going to move it to the second file. About half way down the second file you will find the comment:

# Set up core support WP Hooks

Add the line of code we are removing from the first file under this comment in the second file.

Now – this is all theory at the moment but it does make sense and is (at the very least) one rational explanation of what is happening to you. IF you have a plugin installed that is flushing and rebuilding the WP rewrite rules on a regular basis and doing this within the WP Admin then with the SP code as it is it will fail to include the SP rules leading to a 404 page. By moving that line of code above it will ensure the SP rules be included in any rebuild of this kind.

To be honest it is the only scenario at the moment we can come up with that covers what is happening to you. And it should be stressed that if this DOES resolve your issue then the plugin performing the rebuild should be rooted out as it is very bad practice to flush and rebuild the rules like this.

Anyway – my fingers are crossed on your behalf. I really am hoping this is the key…

 

JB Jan Bosman
Jan Bosman
Member

I’m having this exact same issue.

I’ve noticed a few distinct things. Whatever is going on with the permalinks happens on a timer of somewhere between 5-10 minutes.

Every time one of these frequent 404 errors occurs, no page in the forum will work (for instance, going straight from the 404 error to your profile, or going ‘back’ from the error in topic view to forum view – they’re all 404s). The only way around it I’ve been able to find is to navigate straight back to the Forum Home page, and then to go from there. Once that page is visited, any SP link will work properly. 

I did try the plugin edit you suggested above and it didn’t seem to work. EDIT: Commenting out that line just resulted in every SP page (except Group view) a 404.

Any other ideas? I’m happy to grant admin access to my site if that would help you. We’re about to open it back up to 3,000 active users and their 30,000 posts, so this new bug is untimely to say the least.

Thanks!

MP Mr Papa
Mr Papa
Member

you were not commenting it out, but moving it…  do you actually copy it to the second file? and if you did the change pointed to by post #4, did you undo that?

JB Jan Bosman
Jan Bosman
Member

Right you are! Apologies. I properly moved the line to the second file and…

It seems to work! Haven’t seen a 404 since.

Thank you!

Quick question – as this is a core edit of the plugin files, is this a change I’ll have to make again if I update to a future version of SP?

MP Mr Papa
Mr Papa
Member

No, you shouldnt have to…  if this really is the fix to this rare problem of another plugin screwing with the rewrite rules in the admin… we think it is and this is good confirmation…

this change is already in the core code for 5.3, so you will pick it up when you update…

AL a_creative_life
a_creative_life
Member

I just made the changes as directed above, and I’m still getting 404 error when clicking a link inside an email. However, if the forum is open in one tab, and I click the same link that previously generated a 404 page, it goes to the forum page okay. But this is not a change — in other words, making the edits you suggested didn’t seem to change anything.

 

YS Yellow Swordfish
Yellow Swordfish
Member

Don’t fully follow here…. Are you saying that links provided from emails result in a 404 but links provided within the actual forum do not?