When I start a new Joomla! project, one of the first things that I do is remove the index.php from the URL. You can see this on a fresh install of Joomla! – straight after the domain name and on a child page straight off the domain name before the page name.

This is a default in Joomla! but we can remove it, which is better for SEO and better for user experience.

How To Remove Index.php From Joomla 4

So there are a couple of things that we need to do to remove the index.php. In the system global configuration site, we scroll down to the SEO section.

Search engine friendly URLs are on, which is great, but we also need to turn on use URL rewriting.

URL rewriting in Joomla 4

This will tell us that if we’re on an Apache server, we need to make a change to the htaccess file.

If you are on a windows server, you would change the web config file and there is also some instructions if you’re on a more specialized server.

I’m on an Apache server, so for me, it’s simply changing the htaccess.txt file to a .htaccess file.

Editing The .htaccess File

I’m going to show you this now in my ftp. So now we’re in ftp, we simply find the htaccess.txt file, put a dot on the beginning and remove the .txt.

htaccess file in Joomla

Back to the front end and just a click, refresh. We’ve still got index.php there, but if we remove it, our page still works. More importantly if we go to the child page -that page still works and we no longer have the index.php.

So there we have it – in under two minutes we’ve removed index.php from the URL. This makes the website look more professional, it’s better for SEO and it’s better for a user experience.

Share On Social Media