Troubleshooting index.php” in URLs

By default, Craft is unsure about whether your server is set up to handle URLs without “index.php”, so it makes an educated guess by sending requests to itself without it and checking the response. It caches the results of its findings for 24 hours, or until Craft’s data caches are cleared.

While most of the time it works well, there still may be a false negative now and then. The only way to ensure that your site never includes “index.php” in its generated URLs is to explicitly tell it not to.

You can do that by by opening up craft/config/general.php, and adding this to the array:

'omitScriptNameInUrls' => true,

Once you’ve set omitScriptNameInUrls like this, Craft will take your word for it and stop performing its daily checks.

Applies to Craft CMS 3 and Craft CMS 2.