Home directs to website.com/index.php in the menu.
/contact directs to website.com/index.php/contact.
I have to input the whole URL to bypass index.php from inserting itself before the desired page: Https://website.com/contact. If I log in I get directed to website.com/index.php/user/ if I click on the "my account" I get directed to website.com/user/ what would cause this? I thought it was pathauto or drupal8.0.3 because it happened around 8.0.3
Some links are unable to be changed like hitting the home logo. Please hell determine the cause of this anomaly.

Comments

sushichris created an issue. See original summary.

sourabh.singhal’s picture

Assigned: Unassigned » sourabh.singhal

Hi sushichris,

I am not able to produce this issue on my side, it seems perfectly working on my side, i have tried all the cases which you mentioned in description.
Will you explain more exactly, when or where you will be getting this issue.

Thanks
Sourdrup

cilefen’s picture

Title: index.php » index.php is inserted in menu links
Status: Active » Postponed (maintainer needs more info)
Issue tags: -index.php

More information is needed in order to work on this issue. Is the problem confined to menu links? Are there error messages? Is mod_rewrite configured properly? What web server is in use? Are any menu-related contrib modules in use?

sushichris’s picture

Hi guys thanks for responding, I am not sure what is causing this, originally I thought it could be pathauto but now I am not so sure. I am only getting this issue on one site. I will probably be reinstalling to be rid of this issue, I was hoping to establish the cause because this has been driving me nuts since 8.0.3

So in the menu settings I disable the default home link, I have to as there is no way to change the url destination like when creating a custom menu link. Resulting in mysite.com/index.php/
Same with the default contact link. It can't be edited so I disable and create a new one with https://mysite.com/contact as the destination because just putting /contact will result in https://mysite.com/index.php/contact

As for the mod_rewrite I haven't really changed anything except for uncommenting the following:

    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

And changed this from [F] to [T] so as to access mysite.com/subdirectory:

RewriteRule "^(.+/.*|autoload)\.php($|/)" - [T]

I hope this is useful

liam morland’s picture

Version: 8.0.5 » 8.6.9
Status: Postponed (maintainer needs more info) » Active

I am having this problem as well. I see it on many places links appear: menus, breadcrumbs, tabs. One place it does not appear: If I am on admin/config, the links to the various config pages do not have index.php. Note that this is not index.php?q=path; that would be a matter of clean URLs not working. The problem is that links to a page like admin/people appears as index.php/admin/people. If I edit the URL bar to remove index.php/, the page loads, but still contains faulty links to other pages. I don't have any menu modules installed.

gmrossello’s picture

For our project we are having also problems with /index.php/ in the url.
In our case, problems appear only in the production environtment. The only differences in this environtment are:
- Two machines are running drupal instances and a Load Balancer is distributing the traffic between them.
- The ssl connection, that os configured in the Load Balancer server.
The machines are working on a centos 7 with a 7.28 version of php.

The AllowOverride All for the correct directory was changed in the httpd configuration file.

In some places, is mentioned that the possible cause of the is in the ssl conf file for the secure site:

https://www.drupal.org/forum/support/installing-drupal/2009-03-10/ssl-an...
https://www.drupal.org/node/475730#comment-1726870

But in our case, the one that has this configuration is the Load Balancerthe, not the production machines.
Someone found a solution for this issue?

travellercon’s picture

This is kinda a big deal.

In my case I can remove it with clearing the cache. However, when people add new content, it can pop back up, seemingly randomly.

So I have to run an agent to look to index.php appearing in links and then text me so I can rebuild the cache.

If I were a better coder I would fix it. Alas I am not.

wtuvell’s picture

See my recent re-finding of this issue, at https://www.drupal.org/project/drupal/issues/3054451.

wtuvell’s picture

Re-checking in on this again this morning, I'm seeing that the problem has disappeared for all browsers I'm trying, except for Vivaldi (which is my first/main choice). I think I'll talk to them.

derherrberger’s picture

Hi guys,
we're struggling with exactly the same issue on two up-to-date, multilingual Drupal-8 sites (many other d8, multilingual sites don't have the issue):
* both sites have completely different Hosting-Environments
* most of the time all URLs in the menus appear correctly
* then randomly URLs with /index.php/url-alias appear for example on the logo home link, but also in some of the menus
* the issue affects all URLs in one menu, but not all menus on one page.

After trying to fix the bug, clearing cache, running cron etc. all URLs are rendered correctly, then randomly the index.php URLs reappear, e.g. after switching the language.

kscheirer’s picture

Version: 8.6.9 » 8.7.x-dev
Assigned: sourabh.singhal » Unassigned
Category: Support request » Bug report
Priority: Normal » Major

Bumping this to major, at least until we understand what's causing this.

I'm experiencing the same symptoms on a D8.7.1 site hosted on Pantheon. That means nginx instead of apache, and no config changes are possible from their normal hosting setup.

Most of the time links are correct, but when using the "Contextual edit" links or clicking the site logo it sometimes starts. It is intermittent behavior, seems related to cache based on reports above.

I don't have concrete steps to reproduce yet, but will keep investigating. Seems like this issue was dormant until ~3mo ago with 8.6.9, perhaps a regression introduced around that time?

rewted’s picture

@kscheirer some additional observations in my thread. I'd agree with the timeline, seemed to have started in the past few months, I am currently at 8.7.3

kscheirer’s picture

Version: 8.7.x-dev » 8.8.x-dev

Updated to latest dev

dawehner’s picture

This issue and https://www.drupal.org/project/drupal/issues/483150 feels like they should be solved together potentially.

waelk78’s picture

I have the same problem today and semrush is considering the extra /index.php/ as duplicate
Any news on how to fix it?

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

rewted’s picture

In 8.8.1 I'm still seeing on the Frontpage View, the Pager links having ../?destination=/&_exception_statuscode=404&page=1 in the URL where as normally they will be ../?page=1

Clearing the cache they revert back to normal. Has anyone noticed this before or know the cause?

liam morland’s picture

I continue to occasionally have this problem and it is fixed by a cache rebuild.

andileco’s picture

I'm having this issue and it's very difficult to get rid of it. Clearing cache (from performance>clear caches) only occasionally removes it. I don't have Drush installed on my box.

I'm really appreciate any ideas that haven't already been mentioned.

We're using multiple containers with Apache servers and CloudFront.

andileco’s picture

OK, we were able to prevent index.php in our URLs by removing custom HTTP error handling from CloudFront - hope this helps others!

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Active » Closed (duplicate)
Issue tags: +Bug Smash Initiative
Related issues: +#3050261: index.php randomly appears in friendly URLs

@sushichris, thanks for the report.

I have found several issues about index.php appearing in URLs. Even though this is earlier I am marking it as a duplicate of #3050261: index.php randomly appears in friendly URLs which has more discussion of solutions.

Thanks.

karenann’s picture

I have an occurrence of this and here's how it's happening.

I have a view page with a path /policies
I have the "Default front page" configured to be /policies
I have the page.html.twig set to expose page.breadcrumb

On the home page and /policies page, the Home breadcrumb is normal. On every other page, the Home breadcrumb is /index.php

eugenechechel’s picture

run drush cc render

dewancodes’s picture

drush cr did not fix the issue on LIVE server. Its working fine on DEV. It creates this issue on menu items where path is starting with '/'. If I use menu item path with 'https: // www. mysite .com', it works fine on those menu items.

Drupal: 11.2.10