访问web服务器上限制从外部网站访问的目录


Accessing a directory on a web server that has restricted access from an external Web site

我正在使用模板渲染Wordpress页面。页面上有一个指向外部网站上另一个网页的链接(即,它完全在另一个域上),thios页面需要登录。对包含该页面的目录的访问由Web配置控制,并且仅在成功登录时有效。web.config如下:

<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    'Windows'Microsoft.Net'Framework'v2.x'Config 
-->
<configuration>
     <appSettings/>
     <connectionStrings/>
     <system.web>
     <authorization>
         <allow roles="Administrator, Client"/>
         <deny users="*"/>
     </authorization>
     </system.web>
</configuration>

我如何修改这个或在外部网站中进行任何其他更改,以便我的wordpress页面上的链接成功访问外部网站,并且我可以在不必登录的情况下查看页面(比如为来自我的wordpress网站的请求破例或类似的事情)。)我想这么做是因为同一个用户已经登录了我的wordpress网站,并且必须再次登录这个外部网站才能查看外部页面。这可行吗?

p.S:我提到的外部网站是一个基于ASP.NET的网站。

在web.config中创建一个Location元素,并为该特定位置添加授权元素。通过这种方式,您可以控制对特定位置的访问。