Support » Fixing WordPress » Add file extensions to “pages”

  • I’d like to be able to add a file extension to a “Page” in v2.5. I have been able to modify my permalinks to add them to posts. Adding an extension to the permalink (in Manage/Pages) drops the period (the extension gets merged into the filename). Any help with this matter is most appreciated.


Viewing 3 replies - 1 through 3 (of 3 total)
  • I have found a solution, it’s not quite that elegant but it works. It could be better implemented (eg: check and dynamically input the permalink extension) but here’s my fix:

    Line 510, /wp-includes/rewrite.php

    $this->page_structure = $this->root . '%pagename%';

    Change to:

    $this->page_structure = $this->root . '%pagename%.php';

    Or you can simply replace .php with the extension that your permalinks use. It has to be the same extension that’s set in your Options > Permalinks or you’ll get a 404 error.

    I have been searching for hours for a way to force WordPress pages to have a .html or .php file extension – this is 100% perfect. I would also like to add that you can regulate your category, search, tag, etc. sections by doing the same thing to the lines previous to this one. Thanks for the help Aeriff!

    Search for HTML to pages plugin, that’ll do the job.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add file extensions to “pages”’ is closed to new replies.