Support Forum

BUG: After upgrading to SP 5.6 Permalink leads to 404 error

BL Blaise
Blaise
Member

Hi,

I am getting a 404 error on my forum links… approximately half of the time. Then when I hit refresh on the browser my page displays correctly…

My forum permalink structure is:

http://my_url/forum/forum_slug/topic_slug

I have:

  • deleted my page cache, several times (zencache)
  • flushed my object cache (Redis)
  • In wordpress, resaved the permalink structure (settings / permalink -> save)
  • In SP Admin panel, saved the permalink structure (Integration / page and permalink)
  • and finally purchased a bronze membership support plan

This also affect the private messaging system.

Any thoughts?

18 Answers

New Answer

BL Blaise
Blaise
Member

Same problem I had in December, but this time running these fixes did not help:

https://simple-press.com/support-forum/sp5-general-topics/after-upgrading-to-5-6-all-forum-internal-links-404-error/

BL Blaise
Blaise
Member

I should correct the title: the problem arrived when upgrading to SP 5.6.5

YS Yellow Swordfish
Yellow Swordfish
Member

Well as once again you are the only user experiencing this issue and it has also happened to you once again following updating then I think the first thing I need to do is go back to my very last comment on the thread you have linked to.

You clearly seem to have some instability in your WordPress rewrite rules and I am guessing you never did find out what mght be causing it. So let’s look at that again.

What else changed over this update period. I assume WordPress itself – so what about other plugins and your theme? And back to the previous question which was not answered at the time regarding any other plugin that may be performing rewrites? 

BL Blaise
Blaise
Member

Hi,

I keep my theme, wordpress and plugins up to date, so all of these have been upgraded in the last 3 months. 

The only plugin I changed was moving from Google XML sitemap to Better WP GoogleXML sitemap. 

In terms of plugins with rewrite settings:

– events manager

– Better WordPress Google XML Sitemaps

 

I don’t know how to continue in my chase for the bug.

YS Yellow Swordfish
Yellow Swordfish
Member

Blaise Fiedler said
Hi,

I keep my theme, wordpress and plugins up to date, so all of these have been upgraded in the last 3 months. 

The only plugin I changed was moving from Google XML sitemap to Better WP GoogleXML sitemap. 

In terms of plugins with rewrite settings:

– events manager

– Better WordPress Google XML Sitemaps

I don’t know how to continue in my chase for the bug.

Nor me to be perfectly honest. While there may be other conditions the only 2 events I have encountered over many years where 404’s become prevalent are if:

  1. Something has rebuilt the WP rewrite rules without allowing other plugins to add their requirements (i.e., by replacing rules instead of adding them)
  2. Something is manipulating the URL’s after the http request but before processing starts . Yoast SEO can do this, for example, as have some redirection plugins encountered n the past.

I can’t, of course, test whether either of these conditions applies. You would basically need to deactivate items one at a time – re-update permalinks and re-test to find out. Your site history strongly suggests, however, that something along these lines needs to be carried out.

MP Mr Papa
Mr Papa
Member

so still now working?  go to the wp settings – permalinks page… this will update all rules…  if not working, try going to forum – integration – page and permalink and updating ours again…  if still not working, then I would deactivate and reactivate simple press plugin…  do NOT uninstall, just deactivate and reactivate… see if better..

if not, then you need to do as Andy says (and may want to anyways) and debug further as another plugin may be incorrectly doing rewrite rules…  start by changing to default wp theme… better?  if not, deactivate all other plugins and see how working… if working, reactivate one by one until breaks…

any special rules in .htaccess file in your wp root?

BL Blaise
Blaise
Member

Thanks a lot Mr Papa for your support. What really bugs me is that it sometimes works, sometimes does not, and when it does not (I get a 404) a simple page refresh *always* works. 

 

I’m running a blend of apache and nginx. I checked .htaccess and it all looks standard:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

I implemented a rewriting rules debugging tool. 

When the page loads correctly I get:

<!- Matched Rewrite Rule: forum/([^/]+)/([^/]+)/?$ ->
<!- Matched Rewrite Query: pagename=forum&sf_forum=suggestions-et-questions-sur-le-site&sf_topic=topic-slug ->

When the page does not load correctly:

<!- Matched Rewrite Rule: ?None? ->
<!- Matched Rewrite Query: None ->
<!- Loaded Template: 404.php ->

MP Mr Papa
Mr Papa
Member

sometimes works and sometimes not??

are you caching anything?  or minifying js scripts?

do you have link to site?

BL Blaise
Blaise
Member

Mr Papa said
so still now working?  go to the wp settings – permalinks page… this will update all rules…  if not working, try going to forum – integration – page and permalink and updating ours again…  if still not working, then I would deactivate and reactivate simple press plugin…  do NOT uninstall, just deactivate and reactivate… 

Thanks! I tried steps 1 and 2 most of the afternoon, but did not think about step 3. Will try and report.

BL Blaise
Blaise
Member

Mr Papa said
sometimes works and sometimes not??

are you caching anything?  or minifying js scripts?

do you have link to site?

Yes: I am heavily caching:

– guests are served full page caches for all my site *except simple press*. This is thru zencache / cometcache.

– there is also a layer of object caching (Redis).

No, I am no longer minifying .JS / .CSS.

I will PM you a link to the site with a member access as I am not sure guests have any issues (guests never report bugs).

YS Yellow Swordfish
Yellow Swordfish
Member

Can you please make it an SP Admin account. We WILL need to deactivate your other WP plugins and possibly swap tho the WP theme briefly.If this is unacceptable then there is probably little more we can do.

BL Blaise
Blaise
Member

I think the problem is gone. Mr Papa’s trick of deactivating and re-activating Simple Press worked. Well, I tried about 50 pages and did not get the 404 error, so I can’t conclude a 100% success, but still much better than the 50% success I had. 

 

@yellow-swordfish : I’m sorry, but my site has heavy traffic. I cannot allow turning on and off WP plugins or themes, even briefly.

YS Yellow Swordfish
Yellow Swordfish
Member

Blaise Fiedler said
I think the problem is gone. Mr Papa’s trick of deactivating and re-activating Simple Press worked. Well, I tried about 50 pages and did not get the 404 error, so I can’t conclude a 100% success, but still much better than the 50% success I had. 

OK – all this activity really does is rebuild the permalinks/rewrite rules once again

@yellow-swordfish : I’m sorry, but my site has heavy traffic. I cannot allow turning on and off WP plugins or themes, even briefly.

Ok – but remember for the next time as it may well continue to happen if the root problem is not resolved – but this is what I said last time

The plugin you were asking about is ‘mentions’: https://simple-press.com/downloads/mentions-plugin/