Recent comments

🇭🇰Hong Kong VortexCentrum

I tried to delete this but couldn't.

Please ignore it.

🇭🇰Hong Kong VortexCentrum

These are all technical solutions. But they weren't why one of my pages would not load and instead visitors were taken to the front page.

It took a bit of finding but it all came down to human error. Mine.

These days, I work in D9 or 10 but I have a couple of things still on 7.

There's a difference between 7 and the later versions in the URL box.

For 9 and 10, a leading slash is required.

For 7 it must not be put there.

So, new habits die hard and I put the leading slash when I created a page in 7.

This in or not-in situation was not a problem when this thread began but perhaps my error might help someone now.

🇭🇰Hong Kong VortexCentrum

D10.0.1 (or might be 10.0.2 - I did a Composer update but Drupal is still reporting the previous version).

I have cleared Drupal, server and local caches often.

NO anonymous access to any pages. Access Denied.

Path: /publications/web/front. Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: in Drupal\Core\Routing\AccessAwareRouter->checkAccess() (line 112 of [redacted]/publications/web/core/lib/Drupal/Core/Routing/AccessAwareRouter.php).

Line 112 says
throw new CacheableAccessDeniedHttpException($access_result, $access_result instanceof AccessResultReasonInterface ? $access_result->getReason() : '');

Looking at the logs, it seems that the exception report is logged for all my activity as admin, too,

.htaccess has been replicated from another site that works. Includes "allow from all" but in any case, that can't be the problem because the site is loading, then refusing access. So it's an internal Drupal problem.

I have not tampered with Drupal's own .htaccess because I've never needed to in the past.

Tried No. 8 and gained anonymous access but, as the warning note says, it gave anonymous users full edit/delete control over content. So I undid that.

Didn't try No. 9 - too many "routing.yml" files. The risk of chaos is too great.

Given this, it appears that the issue comes down to permissions.

Next: I still had the page open from when I tested solution #8. So I went to nodeaccess settings. Granted anonymous access to nodes of that type, went to the page and refreshed. Once more, access denied.

One odd thing has been the frequency of "rebuild permissions" warnings.

I've used NodeAccess since the early days of D7.

It turns out that the solution to this problem is to uninstall NodeAccess.

Losing the functionality I'm used to is a pain but it's better than having a website no one can enter.

And it takes one minute instead of the seven hours I've spent looking for the solution to the original problem.

Hope this helps others.

Production build 0.71.5 2024