WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] adding .html to end of url (11 posts)

  1. vickyh
    Member
    Posted 6 years ago #

    I'd like to add .html to the end of my urls and in Permalinks I added this custom structure

    /%category%/%postname%.html

    However my menu links seem to be ignoring the .html part. Do I have to do something else to make this work?

    Thanks

  2. snakey
    Member
    Posted 6 years ago #

    I'd try puting a backslash before the dot (\.html). Sometimes this works in .htaccess. Just a guess, but you can try :)

  3. Kalessin
    Member
    Posted 6 years ago #

    You don't need to escape (add a backslash before) the dot. The problem, I suspect, is that the items that aren't being updated are pages, not posts. Page permalinks behave slightly differently and I suspect you'll need a custom plugin to add .html to the end of a page.

  4. vickyh
    Member
    Posted 6 years ago #

    Yes - I've just realised that the posts have .html added to them, but pages don't.

  5. ftblguy
    Member
    Posted 6 years ago #

    Can we re-open this discussion? vickyh came to the conclusion that using the custom URL structure "/%category%/%postname%.html" applies to Posts, but not Pages.

    So my question is this: how do I get my Pages to end in .html? Help! Thanks!

  6. moshu
    Member
    Posted 6 years ago #

    You don't. That's how WP works. Sorry.

  7. ftblguy
    Member
    Posted 6 years ago #

    That's too bad that there's no flexibility for this. Thanks for the very quick response, moshu. Much appreciated!

  8. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Edit the Pages in question. Change their slugs to have the .html in them.

  9. ftblguy
    Member
    Posted 6 years ago #

    Hi Otto42. I tried that. When you attempt to add .html to the slug, WordPress automatically removes the period. So the slug then reads "pagenamehtml" instead of "pagename.html". I've tried to escape the period with a backslash (pagename\.html) to no avail. Same result. I've even tried a double dot (pagename..html) also to no avail. Same result. Always just comes back as "pagenamehtml". But thank you for the suggestion.

  10. wahs
    Member
    Posted 6 years ago #

    Try this:
    http://wordpress.org/support/topic/147118?replies=4#post-673065

    It works for me. Some say don't work.

  11. wahs
    Member
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic