How to Remove .index.php From URLs in Joomla 4
- by Naveen Kumar
- on Tutorials
How to remove .index.php from URLs in Joomla 4
At the time of writing this post, we have Joomla 4 Beta 2. And in the series of Joomla 4 tutorials, today, I am going to remove .index.php from the Joomla 4 website urls and make them search engine and user friendly.
So now, the question is why we need to remove .index.php from our site URLs?
If I have to say in simple words, removing index.php makes the URL look cleaner, professional, and SEO friendly. Google only loves what the users can remember.
And if we think from a user perspective, it is tough to keep in mind that he needs to add index.php as well to open a specific URL.
How to remove .Index.php from Joomla 4 Site URL?
These steps apply to Joomla 3 websites as well. There is a small interface difference, and steps will be the same.
Enable URL Rewriting
To remove the .index.php from your URL, you need to enable the URL Rewriting feature from Joomla backend. Thanks to Joomla that you don't need to mess with coding or use any third-party extension to do this job.
Navigate to Global Configurations > SEO Settings. Now enable Search Engine Friendly URL. As soon as you enable it, you will have a few more options.
Now, Enable Use URL Rewriting.
Now you need to move to the next step; otherwise, your URLs will return 404 errors.
Renaming the Files
If you are an Apache user, you need to rename the htaccess.txt file to .htaccess. You can find the htaccess.txt file on the root of your website.
And if you are an IIS user, you need to rename web.config.txt to web.config and install IIS URL Rewrite Module before activating.
This is how you will be able to remove the .index.php from your Joomla site URL.