Weekend Sale! Get EVERYTHING at Joomlashack for as low as $97 per year!  Sale ends in 1 Day
Joomlashack

How to Remove .html in Joomla's URLs

How to Remove .html in Joomla's URLs

One Joomlashack University student was wondering how to remove the .html at the end of his URLs.

This tutorial will show you how to do that and provide a useful SEO tip.

Why would you remove .html?

Before Content Management Systems were around, there was HTML. Almost all web pages on the web had ".html" behind them.

When Joomla came around, it needed a way to provide backward compatibility with what search engines and users expected. So it added the feature to add ".html" at the end of the URL.

How to turn off the .html suffix

  • Go to the Joomla administrator area
  • Go to System -> Global Configuration (top menu)
  • Click the "Site" tab
  • Set the "Adds Suffix to URL" option to "No"
  • Click "Save & Close" 
How to Remove .html in Joomla's URLs
 

After turning it off, go to your home page, refresh the page, and make sure links work.

Important SEO Tip

With this change, you've modified practically all the URLs for your site. So any old links would likely result in 404s.

To fix this, edit your .htaccess file and add the following code after "RewriteEngine On":

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} \.html$
RewriteRule ^(.*)\.html$ /$1 [R,L]

Be sure to test any old links to make sure they redirect properly. Or add .html after new links and see if they redirect to the non-html URL version.


About the author

Nick is the Director of Support at Joomlashack and you can find him in almost every area of the site, from answering support requests and account questions to creating tutorials and software.

 

 

Since 2005, Joomlashack has been a leading supplier of free and commercial Joomla templates, Joomla extensions, and Joomla Training.
Joomlashack.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.