Add .html & .php to the URL of WordPress PAGES (not Posts)

Yesterday’s daily tip was about adding .html to the URL of posts by tacking .html onto the end of permalinks.

But that little trick of adding .html to permalinks doesn’t affect the PAGES on your site. It affects the posts, but not pages.

The solution for attaching .html to a Page can be accomplished with a plugin — .html on PAGES is one such plugin.

If you have the need for .php on your Pages, there is also a plugin for that — .php on PAGES.

 

NOTE: As someone pointed out in the comments on the .html post yesterday, be watchful for any issues that may occur if you are using a caching plugin. Just check things out every now and then to make sure all is working as it should.

Featured Plugin - WordPress Google Maps Plugin

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

Photo: www internet web address concept from BigStock

Tags ,

Comments (10)

    • Malik – As Hunter mentions below, it’s good for when you’re moving an existing site over to WP and your pages already end in .html or .php.

      This isn’t a recommendation to use it on a fresh site. I don’t think it would make any difference. Some people have theories that it might make it seem like a more permanent page, and therefore will be seen by Google as having more evergreen value, but I’m not sure anyone has proven this.

      We discussed this a little in the comments from yesterday’s post: http://wpmu.org/how-to-add-html-to-the-end-of-a-wordpress-url/

  1. Totally makes sense if you have existing pages that you want content managed that are not currently. If your site is legacy, with good SEO on certain page names that end in “.html”. Even with permanent redirects, you’ll probably lose juice. Why not simply recreate the page name under WordPress and change the extension to “.html”, preserving all other aspects of the permalink.

      • Hey there- Like you, I am redoing an old static sight into wordpress and want to keep the old .html url structures for search rank purposes.

        The .html on pages plugin does work like a charm. Unfortunately, I can’t figure out how to exclude the “blog” page. I have set the blog functionality to my “blog” page and want the url to read “mysite.com/blog/” (presently “mysite.com/blog.html/”.)

        I tried using the code that Jeff pointed to in the previous post (http://webdevstudios.com/2009/11/02/change-wordpress-permalinks-on-pages-to-have-a-html-extension/) but I get an error when I click the blog page link that says the redirect wasn’t working properly.

        Wondering if you had a chance to look at it and if you know of any way to simply exclude the .html extension for a single page? If you could help me out, I’d be much obliged.

        Cheers.

  2. Hi, I have exactly the same problem as J.Brown. The plugin created .html on each page but my blog looks like this “mysite.com/blog.html/” which is weird. I need to exclude it from being assigned a .html at the end.
    Any ideas?

    Thanks in advance

  3. Hi,

    I just tried this on a wp 3.8 site and it worked fine.

    However on a multisite it gives me an error;

    [an error occurred while processing this directive]

    when I try to view the page on one of the sites with .php extension activated.

    This happens on the root site and other test site, and with plugin activated singly or network activated.

    The install has the standard .htaccess for a multisite so I am wondering if the plugin is compatible with multisite, and if anyone had managed to get it working on one..?

    thanks,

    Iain

Participate