How can Joomla redirect incoming URLs that still contain index.php?

The Citead team, updated

In short. Enable strict index.php handling with URL rewriting so Joomla redirects incoming URLs to the version without index.php.

Definition: Joomla's System - SEF plugin can remove index.php from URLs and redirect incoming requests that contain it to the version without it. The documented redirect behavior applies when Use URL Rewriting is enabled in Global Configuration.

Key facts

  • Joomla's SEO basics documentation describes the System - SEF plugin as having three settings, including strict handling of index.php (Joomla SEO Basics).
  • Strict handling removes index.php from a URL that still contains it and redirects incoming requests with index.php to the version without it (Joomla SEO Basics).
  • The setting is documented as conditional on Use URL Rewriting being enabled in Global Configuration (Joomla SEO Basics).
  • Joomla's URL guide requires Search Engine Friendly URLs and Use URL Rewriting to be set to Yes, plus a server rewrite file where applicable (Search Engine Friendly URLs).
  • With SEF URLs enabled but URL rewriting absent, Joomla's example still contains index.php; with rewriting and .htaccess enabled, its example does not (Search Engine Friendly URLs).

What does strict handling of index.php do?

The System - SEF plugin is Joomla's documented place for this URL normalization. Its Strict handling of index.php option has two related effects: it removes index.php when a generated URL still contains it, and it redirects an incoming request that contains index.php to the version without it. The Joomla documentation places this behavior under the condition that Use URL Rewriting is enabled in Global Configuration (Joomla SEO Basics).

The option belongs to a plugin with three documented settings. The same page also names Site Domain and Trailing slash for URLs; the latter applies only when Add suffix to URL is disabled. Those are separate URL policies from the index.php handling described here.

What must be enabled before the redirect can work?

The prerequisite is the server-backed URL rewriting path. Joomla's URL guide lists Search Engine Friendly URLs set to Yes, Use URL Rewriting set to Yes, and an appropriate rewrite file in the site root. For Apache, the guide says to rename htaccess.txt to .htaccess; for NginX or another server, it points to that server's external documentation (Search Engine Friendly URLs).

Global Configuration
Search Engine Friendly URLs: Yes
Use URL Rewriting: Yes

Apache site root
htaccess.txt -> .htaccess

The order matters for diagnosis: the SEF plugin setting depends on URL rewriting, while the URL guide describes the rewrite-file step as part of activating search engine friendly URLs. The documentation's Apache example therefore treats the renamed file as an enabled server configuration, not as a Joomla plugin option.

What URL shape should a site show?

Joomla's example shows the intermediate state clearly. With SEF URLs enabled but without URL rewriting, the sample address is https://www.example.com/index.php/sample-layouts/articles. That is the form in which index.php remains in the path (Search Engine Friendly URLs).

With SEF URLs, URL rewriting, and .htaccess enabled, the same example becomes https://www.example.com/sample-layouts/articles.html when Add Suffix to URL is set to Yes. The strict handling setting addresses incoming requests that still use the former form, while the rewriting prerequisite enables the latter form.

How can you check the configuration?

Start in Global Configuration and verify the two URL options named by Joomla's guide. On Apache, verify that the site-root file is .htaccess, because the guide specifically identifies renaming htaccess.txt as the Apache step. Then inspect an address that still contains index.php and follow the result. The SEO basics page documents the expected behavior as a redirect to the corresponding address without index.php (Joomla SEO Basics).

FAQ

Does strict handling work with URL rewriting disabled?

No. Joomla documents the option as applying when Use URL Rewriting is enabled in Global Configuration. Enable the rewrite prerequisite before testing the redirect (Joomla SEO Basics).

What should you rename on an Apache Joomla site?

Rename htaccess.txt to .htaccess in the site root, then enable the two URL options in Global Configuration. Joomla gives this as the Apache step for activating search engine friendly URLs (Search Engine Friendly URLs).

What happens to an incoming URL containing index.php?

When strict handling is enabled with URL rewriting, Joomla's documentation says the request is redirected to the version without index.php (Joomla SEO Basics).

Sources

  1. Joomla, "SEO Basics", undated
  2. Joomla, "Search Engine Friendly URLs", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark