Eugene
Eugene

Reputation: 1057

How to export/import host headers from IIS7 website?

I have an application which has 55 host headers. How can I copy those bindings to a different application within the same IIS?

Upvotes: 17

Views: 7755

Answers (2)

Ajay Kumar
Ajay Kumar

Reputation: 3250

Why not just copy the content from the source site's httpProtocol tag in the web.config and paste it for the rest of the target sites. For me it is a simpler approach as I couldn't find this info in this file - C:\Windows\System32\inetsrv\config\applicationHost.config

        <httpProtocol>
            <customHeaders>
                <remove name="X-Powered-By" />
                <add name="Access-Control-Allow-Origin" value="https://myserver/mysite/" />
                <add name="Access-Control-Allow-Headers" value="Content-Type" />
                <add name="Access-Control-Allow-Methods" value="GET,POST,PUT,DELETE,OPTIONS" />
                <add name="Access-Control-Allow-Credentials" value="true" />
                <add name="Referrer-Policy" value="strict-origin-when-cross-origin" />
                <add name="X-Content-Type-Options" value="nosniff" />
                <add name="X-Frame-Options" value="SAMEORIGIN" />
                <add name="X-XSS-Protection" value="1" />
            </customHeaders>
        </httpProtocol>

Upvotes: 0

Cleber Dantas
Cleber Dantas

Reputation: 464

Ok take care by doing this...

Go to: C:\Windows\System32\inetsrv\config and open applicationHost.config

This file has all the sites configurations.

Find the correct site and copy the binding information to another site.

Upvotes: 23

Related Questions