Allow APACHE/IIS environment to support shtml and shtml files

Source: Internet
Author: User

What is the relationship between HTML or HTM and shtml or shtm

HTML or HTM is a static page format, which means that the server does not need to parse the script, or that there is no server-side script, and that shtml or shtm is treated as a dynamic programming language when there is a server-side executable script, as it is based on SSI technology, such as ASP , JSP, or PHP. The function is the same as HTML or HTM when shtml or shtm does not contain server-side executable scripts.

Let Apache support shtml and shtml files

Apache does not support SSI by default, and we need to change httpd.conf to configure it. Here I take the Windows platform Apache 2.0.x For example, open the httpd.conf file in the Conf directory, search "AddType text/html. shtml" to find:

The code is as follows Copy Code

# AddType text/html. shtml
# Addoutputfilter INCLUDES. shtml

remove the # in front of these two lines .

Then search "Options Indexes followsymlinks"

Add "Includes" after the search to the line

The line will change to Options Indexes followsymlinks Includes

Familiarity with the Apache manual may feel easier.

Save httpd.conf, restart Apache

This completes the setup of the Apache SSI.

Verify SSI Configuration Succeeded

Create a new file on the server directory ssitest.shtml
The contents of the file are
<!--#echo var= "date_local"-->
The echo element is simply a value that feeds back a variable. There are many standard variables that contain all the environment variables that are valid for the CGI program. Alternatively, you can use the set element to define your specific variable.
Open to get the following content
Tuesday, 26-aug-2008 10:25:53 China Standard Time
Indicates that the configuration SSI was successful, and if there are no similar outputs, check the Apache version or the configuration is correct


let IIS support sHTML and shtml files

First, enter the IIS Web site Manager, switch to the Home Directory tab, and then click the Configure button

You will then find an application map with a ". shtml" extension, as shown in the following illustration:

If not, you need to click the "Add" button, the executable address is "C:windowssystem32inetsrvssinc.dll" (Note that C disk is the system disk), the extension is ". sHTML", the action is limited to "Get,post", the following figure:

In this way, IIS supports the sHTML suffix Web page.

Typically, IIS is supported shtml by default after installation.

In the Web service extension, set the include file on server side as allowed.

At this point, IIS can run the Web page of the shtml suffix.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.