WordPress HTML File Extensions
One of most annoying things I see on websites is when the pages do not end with an seo friendly url, you know the ones than end with numbers or ? marks and kinda look this http://www.xyz.com/press/releasedetail.asp?pressid=5. I just can’t figure out why people don’t take the time to fix this or at least find someone who knows how to fix it for them. When switching this site to the wordpress format I wasn’t sure if you could make the urls end in .html, reason being is because I hadn’t seen any that did, most would just end with say ‘site.com/contact/. Now there is nothing with that format but I prefer to have pages end with some kind of file extension.
In wordpress you can write a permalink structure for all post to end in .html, however this does not work if you create Pages, not sure why they set it up that way but that’s just the way it is. So if you want all of your pages and post to end in a .html format then follow the instructions below:
- From the wordpress dashboard select Settings/Permalinks.
- Under Common Settings select Custom Structure and type /%postname%.html/ into the field.
- Save your changes. (View one of your post and you will notice that they end in .html but the pages do not).
- Download HTML on Pages by IntroSites and upload it to your plugins folder.
- Activate the plugin. (View one of your pages, example would be your contact page and notice how they now end with .html.
One note about the plugin, although it does add .html to your pages it also adds a trailing slash at the end of your post. Example: /pagename.html/ when it should read /pagename.html. In order to fix this you will need to install the Smart Trailing Slash plugin and activate it. This plugin will remove the trailing slash from the end of any page that ends with .html or .php, but will add a trailing slash if no file extension is present. For example, if you remove the slash fromÂ /%postname%.html/ and change it to /%postname%.html this would remove the slash from the end of the posts but your category pages would looking this: www.site.com/category/seo , the smart trailing slash plugin will correct this by adding the needed slash at the end of the folder.
For the most part you really do not need to do this to your site, you could still get good ranking results without doing it , but doing it will make your page names look alot more cleaner.
That is it, if you have followed the instructions above correctly then all of your pages and post will end in .html. For any trouble shooting questions please visit the authors of the plugins.