How to Remove Index.php from URL in Joomla 4

In this tutorial, we will be looking at removing index.php from the URL’s generated on the frontend for better SEO of your Joomla 4 site.

By default here is what a menu item URL looks like in Joomla.

http://localhost/joomla4_alpha4/index.php/movies

Explaining the URL a little:

http://localhost/joomla4_alpha is the root of a Joomla install if your website name is abc.com your root will be http://abc.com.

index.php/movies/ ==> movies is the alias of the menu item on the backend, index.php is something that’s added to every URL as this is how URL’s works by default in Joomla.

This Joomla tutorial will work for Joomla 3 as well.

Enable URL Rewriting

To enable URL rewriting login to your Joomla backend and go to System >> Global Configuration

How to Remove Index.php from URL in Joomla 4

In the very first tab (site), click the button Use URL rewriting

How to Remove Index.php from URL in Joomla 4

Now before you save the settings here, you have to rename a file or all your website URL’s will result in a 404 error.

Rename htaccess.txt file

Login to the FTP so you can browse files for your Joomla installation.

Once there, rename the file htaccess.txt to .htaccess.

Once done, you can go back to the Joomla screen and save the changes and your new SEF URL’s would look something like http://localhost/joomla4_alpha4/movies, which is much better for SEO.

Let me know if I missed anything in the comments down below?

Watch Video tutorial about How to remove index.php from URL

Naveen
Naveen is a versatile professional with expertise in Product Management, Marketing, QA, and Client Management. He brings a strategic approach to his work, combining technical insights with creative problem-solving to drive impactful outcomes. Outside of work, Naveen enjoys writing poetry and traveling, finding inspiration in words, cultures, and new experiences.