HTML image

How to Remove .html from Your URL

It’s 2013 and there’s no reason to have .html showing on the end of each URL on your website. There’s a simple solution to remove .html from your website to come across more professional.

You need to create an .htaccess file. In order to do that, open Notepad on your computer. In Notepad, input the following:

RewriteEngine on


RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]

In order to save the file, go to File > Save As. For the file name, call it “.htaccess” without the quotes. Change the Save As Type to “All Files.”

Once you have the file saved, upload it to your public_html folder on the server. The last thing you’ll have to do is remove .html from all of your file names.

If you have any questions or comments, please feel free to post below!

Comments

comments

15 thoughts on “How to Remove .html from Your URL

  1. oldans says:

    I love this that was listed. I have been telling a few of my non-tech-savvy friends about this and for the longest time they just thought I was crazy. It takes seconds to complete so anyone can do it, most just don’t know how to!

  2. Jonas Dralle says:

    He spits out this Error:

    “Forbidden
    You don’t have permission to access / on this server.”

    here the complete content of my .htacess:

    ErrorDocument 404 /404.html
    AddHandler server-parsed .html
    AddDefaultCharset utf-8

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.html -f
    RewriteRule ^(.*)$ $1.html

    • Puhlease says:

      Not every company will allow full access to all files like this. I suggest opening a support ticket asking whether this is the case, and if so how you are recommended to resolve the issue.

    • PEvans says:

      I agree with Puhlease, maybe you don’t have access to change the file name and therefore are not able to remove the html. I’d talk to whoever does your IT and they can probably do it for you.

  3. Justin says:

    I wonder how many people actually struggle with following instructions like this, and how many simply lack the confidence to try, for fear of breaking their website.

    • oldans says:

      I think you hit the nail on the head there because honestly I know many people who rather pay to have something simple like this done than worry about their site. It is easy to wipe a site or break something major and then roll back to an old copy. I have done it before myself.

    • Anita says:

      I’d assume a lot of people. I get a bit nervous when doing something like this, even if it is easy. I double check my work at least fifteen times.

  4. Raffy says:

    Justin, I think you will find some people do struggle with doing something like this. One of my friends is not computer savvy and has a hard time doing anything that involves uploading to a server. I’ll have to give this a try.

    • Geordi says:

      It isn’t just uploading to a server that people find hard. There are many things that people struggle with, and for a variety of reasons. Many are simply too nervous to try.

      • Puhlease says:

        And with good reason to in my opinion. There is a very real chance when you start messing, that failing to close a tag for instance could break your page. Simple errors can cause big messes, and that is why people get nervous.

    • Anita says:

      Plenty of people I know would struggle to do this, even if they had someone walking them through every single step. Some people have a hard time handling and dealing with computers. I’ve worked with plenty of people who are intimidated by technology.

  5. braedan says:

    This seems simple enough to do without too much trouble. Thank you for the instructions. The url does look better without the html at the end.

    • Abigail says:

      I do agree that it looks better, or at least more professional when you haven’t got the file names still showing at the end of the website URL.

  6. Giselle says:

    We did this with our website a while ago and I have to say it looks much better to a client to not have that html at the end of the url. Just gives it a clean look compared to other website urls with it still on.

    • Anita says:

      Personally, I prefer sites that don’t have html at the end of them. I can’t really give a valid reason. It might be just like you said; the absence of html makes them appear cleaner.

Leave a Reply

Your email address will not be published. Required fields are marked *