About file extensions for websites

On this page:


Best practice

If the file extension for an HTML page is used, then it should be .html (not .htm or .shtml).

If the file extension for a PHP page is used, then it should be .php (not .php4).

Standardize all file extensions across a site whenever practical, avoiding different extensions for files of the same language or markup type. When practical, remove file extensions from URLs to avoid file extension confusion. Many web frameworks provide this functionality.

IU Web Framework note: By default, the IU Web Framework adheres to this best practice by generating all web pages with the .html file extension, including pages containing PHP scripts.

Policy

There is currently no IU policy governing the use of file extensions on public-facing web pages.

Explanation

Having multiple file extensions for a single site can confuse users attempting to manually enter a URL, especially if they're doing so from memory. If a file extension must be shown, consistent use can help users remember and type the correct URL.

In some uncommon situations, inconsistent file extension use or use of a deprecated file extension (like .php4) can cause a site, application, or web server to behave in unexpected ways.

More information

This is document awoo in the Knowledge Base.
Last modified on 2023-07-17 14:53:16.