Introduction
In the previous article, we were talking about SEF URLs and how they would be used to optimize for human-readable and SEO ranking. We’ve seen how effective they are at removing a jumble of characters and numbers so every component of an URL is neat and easy to memorize.
However, those that are considered SEO-friendly URLs still contain a default text of index.php (right after the domain name). This is a parameter automatically added to each URL but it’s not necessary. It doesn’t bring any impact to SEO and from a user perspective, it becomes even more redundant. Therefore, it is a need to get rid of that text to better the quality of URLs and thus make them more SEO-friendly. Your site visitors will also appreciate that, and so do search engines.
In this tutorial, I will show you how to remove index.php from URLs in Joomla 4.
How to Remove index.php from URLs in Joomla 4
In order to successfully remove index.php from URLs in Joomla 4, you need to do the following two steps:
- Enable the Use URL Rewriting option
- Rename htaccess.txt to .htaccess
Now, let’s dig in!
Enable “Use URL Rewriting”
As pointed out in the previous tutorial, Use URL Rewriting is one of the few more SEO settings to configure revealed upon enabling Search Engine Friendly (SEF) URLs.
So again, from the Home Dashboard, navigate to System > Global Configuration.
Here, make sure you’re on the very first tab, which is Site.
Scroll down and find this section: SEO.
Enable the Use URL Rewriting option.
Click Save & Close and move on to the next step, immediately!!! Otherwise, your URLs will result in 404 errors.
Rename “htaccess.txt” to “.htaccess”
The procedure for renaming the file will vary depending on the web server you are using.
For those using Apache, the most popular server to run Joomla on, you can easily find the htaccess.txt file at the root of your Joomla installation. As the Apache server doesn’t understand the htaccess.txt file, you need to rename it to .htaccess to make the file understandable.
To achieve that, log in to your Joomla file system with an FTP application. I’m currently running localhost so I’ll go there directly on my local system.
Once you’re in, look for the htaccess.txt file.
Rename htaccess.txt to .htaccess and that would do the job.
Now that you have both SEF URLs and Use URL Rewriting enabled/turned on for your Joomla 4 website. You will see it applied everywhere to optimize all your site URLs.
And as the result, that helps remove index.php from URLs in Joomla 4. You can go back and check your SEO-friendly URLs on the front-end.
That’s it! You now know how to remove index.php from URLs in Joomla 4.
Conclusion
By enabling Search Engine Friendly (SEF) URLs and allowing Use URL Rewriting, you are significantly improving the SEO performance of your website. Not only does that help you rank higher in Search Engine Results Page (SERP), but it also positively impacts user experience. Although configuring URLs is only a small step to promoting your website through SEO, you should never take it lightly.
Hope this article was helpful. Don’t hesitate to leave us your comments if you have any questions. Besides, take a look at our Joomla 4 Templates to get your own responsive, high-performance, and SEO-optimized websites.
- What are joomla tags and how are the used? - November 3, 2024
- Why and how to create hidden menu items in Joomla? - October 31, 2024
- How to publish smartslider 3 to joomla 4? - October 31, 2024
Recent Comments