Enable Server Side Include for Apache on Extensionless URI?

Does anyone know how to enable SSI for URIs such as http//domain.com/page ?

(It is straightforward to enable SSI for URIs that have extensions, such as http//domain.com/page.html or http//domain.com/page.shtml — instructions are found on https://httpd.apache.org/docs/current/howto/ssi.html .)

mod_rewrite does not work. Using a symbolic link from page to page.html does not work either.

Thanks!

Answer

Apache has to be told how to respond to URLs that don’t have an extension. The way to do that is with DirectoryIndex and DirectorySlash:

https://httpd.apache.org/docs/current/mod/mod_dir.html

Once it knows how to map those requests to a file, it will use the extension of the file to determine if SSI should be enabled.

Attribution
Source : Link , Question Author : iloveponies , Answer Author : Jonah Benton

Leave a Comment