Protect the XML configuration file without direct access to

Source: Internet
Author: User
Tags add config iis access
xml| Access

Some programs, the configuration file is written in the XML file, this has some benefits, but for sensitive configuration, such as access to passwords, etc., or do not do in the XML configuration good.

If you have already used an XML configuration file and do not want to be accessed directly by others, you can use the following 2 methods.

[1]. Adopt A method of taking over IIS to host XML files.

This method is commonly used in processing pictures of the program, such as to protect the picture resources in the station is not authorized users to access, you can do so, take over the Jpeg,jpg file access request processing, to access the picture and access to the same page can control the rights of visitors.

[2]. Modify Web.config configuration

To add an XML map to C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll in IIS

Then add the following nodes to the Weg.config

<add verb= "*" path= "*.xml" type= "System.Web.HttpNotFoundHandler"/>
When accessing an XML file directly, the server returns a 404 (file not found) error



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.