Let's take a look at the relationship between html or htm and shtml or shtm.
Html or htm is a static page format, that is to say, the server does not need to parse the script, or there is no script executed by the server, and because it is based on SSI technology, shtml or shtm, when there is a server-side executable script, it is viewed as a dynamic programming language, just like asp, jsp, or php. When shtml or shtm does not contain server-side executable scripts, the role of shtml is the same as that of html or htm.
Nginx supports shtml file parsing, but it is disabled by default and needs to be enabled manually.
Add the following in the nginx. conf configuration file http:
| The code is as follows: |
Copy code |
Ssi on; Ssi_silent_errors on; Ssi_types text/shtml; |
Save and restart nginx.
If you want to add the default homepage, you can find the Index option in nginx. conf and write it
| The code is as follows: |
Copy code |
Index index.shtml index.html index.htm |
Save and restart nginx.
If you are using an apache server, we can refer to the following solution
How can your Apache server support SSI?
Apache does not support SSI by default. We need to change httpd. conf for configuration. Take Apache 2.0.x on windows as an example. Open the httpd. conf file in the conf directory and search "AddType text/html. shtml". The search result is as follows:
| The code is as follows: |
Copy code |
# AddType text/html. shtml # AddOutputFilter between Des. shtml
|
Remove # from the front of the two rows.
Search "Options Indexes FollowSymLinks"
Add "des" after the row to be searched"
Change this row to Options Indexes FollowSymLinks Includes
Save httpd. conf and restart apache.