0

I have a Drupal 8 site and am encountering an issue. When I visit the site as an anonymous user and click a link on the menu, it adds /index.php to the url. Then if I navigate to that page and click another link in adds another index.php (i.e. example.com/index.php/index.php/link1/link2) and therefore the page will not load. This does not happen if I am logged into the site, has anyone encountered this before? I tried a fresh htaccess file and beyond that I am stumped. It is on a shared hosting plan. Any help is appreciated.

3
  • Possible duplicate of drupal.stackexchange.com/questions/200596/… Commented Mar 13, 2018 at 2:18
  • Thank you, I did see that question, but there was not a definitive answer that I could find.
    – phandolin
    Commented Mar 13, 2018 at 17:27
  • Have you found a solution to the /index.php/index.php/ problem? I'm afraid this has something to do with Views… Commented Jul 30, 2018 at 13:06

2 Answers 2

5

I had the same problem.

I have a view with links to content, where the URLs are item/[one content's field value]. One day, I watched the view as anonymous user and noticed that these had been changed to index.php/index.php/item/[one content's field value]. (On the other hand, when I visited as administrator user, it didn't happen.)

I didn't know why it happened, and it was solved by executing drush cc render.

However, the problem would still be left.

The environment is Drupal 8.3.9 and PHP 7.0.25.

1

From here:

A solution. Install the Redirect Module, the default setting of Enforce clean and canonical URLs will fix the issue. However, there is also a long outstanding bug Route normalizer: Global Redirect in Drupal which apparently is the cause, but hasn't been pushed to Core yet.

1
  • Redirect fixed it for me (Drupal 9.3.6 Apache 2.4.29 PHP 7.4.28) after index.php was incorrectly inserted in links to uploaded files after many years of not being a problem. So I'd say there's quite likely a bug in core still?
    – iainH
    Commented Feb 20, 2022 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.