I have a site I want to move into WordPress. Currently, each of the site's pages reside in the document root and end in .html.

For example:

Home Page = index.html
About Us Page = about.html

When I Add New Pages in WordPress, the permalink for the about us page (for example) gets created as /about-us/

How do I code WordPress to make the About Us Page = about.html

I do not want to lose SEO status, indexing, etc.

  • May I ask how many pages the old site has? It might actually be easier to redirect the old urls to the new ones without .html. – kraftner Oct 30 '14 at 17:32
  • I have about 155 pages. Why is it easier to redirect urls than to set wordpress to just do that? Does WordPress not allow for page extensions? That would be highly odd if it did not have that feature. – tammy Oct 30 '14 at 17:35

For posts there even is an easy way to change this in the backend:

Settings → Permalinks

Permalink Settings Codex: Permalink Settings

The problem is that for pages this isn't a built in feature. Here is another question that might give you a hint: Add .html (dot HTML) extension to custom post types

The reasons why I proposed using redirects instead of changing the permalink structure are:

  • You stay within defaults in WordPress which avoids unwanted side-effects and always makes it easier later on.
  • Non-html URLs are more common nowadays (and more beautiful if you ask me, but this of course is a matter of taste)

In case you decide to go the redirect route you can add this to your .htaccess file:

RewriteRule (.+)\.html$ /$1/ [L,R]

Source: htaccess redirect all html files


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.