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
The bio for Naveen is coming soon.
I’ve had the great pleasure of hiring JoomDev for several projects over 8 years. The team brought our ideas to life and created the customized application that we only imagined in our minds. We appreciate JoomDev “can do” attitude and co-operation to complete any task until being fully satisfied. Hire JoomDev, you’d be crazy not to!
photo-alex
Alex Shvarts
Fundkite

Contact Sales