• Skip to main content
  • Skip to primary sidebar
  • About
  • Web Design
  • Services
  • Portfolio
  • Get in Touch

Quanta Web Studio

Because you deserve more.

How to remove the .html extension from your WordPress permalinks

How to remove the .html extension from your WordPress permalinks

Back in the early 2000s — and before — most web page addresses ended in the .html extension. That’s not the case anymore, and I wanted to remove the .html extension from the URLs on a particular site. How do you do that with WordPress?

Here’s a case history — and the answer.

EmptyMirrorBooks.com was first built with html/css in 2000. When it was rebuilt with WordPress in 2012, the .html extension on the pages were kept in the interest of keeping the same URLs.

Now it’s 2017, and I wanted to get rid of those .html extensions. (It looks cleaner that way, and the “.html” serve no real purpose anymore.)

The site’s old permalink structure was
/%category%/%postname%.html

I needed to change it to
/%category%/%postname%

And then, so the old .html addresses wouldn’t return 404 errors, I needed to 301 redirect the old .html addresses to the new extensionless ones.

Turns out that it’s easy to do. Here’s how.

First, open .htaccess for editing

You’ll want to have this file open and ready to go. Access it with CPanel’s file editor, or via FTP.

Flush permalinks

In WordPress Admin, go to Settings –> Permalinks.
Select “plain.” Scroll down and save.

Now, select “custom.” Input
/%category%/%postname%

Then, scroll down and click “save.”

Update .htaccess

Put this in your .htaccess, above the WordPress rules. (Don’t forget to replace example.com with your own domain name.)

RewriteRule (.+)\.html?$ https://www.emptymirrorbooks.com/$1/ [R=301,L]

Then save your .htaccess.

That’s all!

Now your URLs should not be showing .html on the end of them — and the old addresses will automatically 301 redirect to the new.

Primary Sidebar

Copyright © 2025 Quanta Web Design | Privacy Policy & FTC disclosures | Web Design Terms of Service | Web Hosting Terms of Service / AUP