Skip to Navigation

.html extension in WordPress

As i’ve been working through a new site build that integrates a WordPress blog I’ve hit across an interesting problem.

Although through WordPress’ permalinks settings you are fully capable of giving a post a .html extension it seems impossible to do the same with pages. This seems a little odd, I tried a couple of things, such as changing the page permalink that it allows you to do, but when you add the .html WordPress removes the dot and leaves you with pagehtml rather than page.html.

Luckily if I enter .html into a browser it will redirect, however this leaves inconsistent url’s through the site. If the system can handle .html for a post, why not a page?

leave a comment

2 Comments

  • We have a similiar issue. We’re implementing Wordpress on our website to handle our news section. We’re using .html extensions on all pages, which isn’t an issue as such since it’s easily changed with /%postname%.html in Permalinks. The problem is that Google likes consistency in URLs and we use .html on folders aswell.

    For instance our (excisting) news section with teasers has this URL:

    domain.com/news.html

    A news article has this URL structure:

    domain.com/news/post.html

    So basically a folder doesn’t have the folder slash, but instead an .html extension a level down, which is removed when viewing an article in that folder/section (of course). Normally in these cases people would have used this type of URL for the folder/section:

    domain.com/news

    or

    domain.com/news/ (adding another level with the slash)

    Our problem is more specifically related to categories in WP. Say a category has the name “Real Estate”. The URL then becomes:

    domain.com/category/real-estate

    Leaving us with a page without the .html extension and consistency is all of the sudden flushed down the drain.

    Any clues to a solution would be much appreciated.

    Lasse

    25th June 2008 @ 6:31 pm
  • I do not believe this

    31st August 2008 @ 6:13 pm
    fornetti

Leave a Comment

required

required, hidden

required