[英]Authentication not working in subdirectories of Wordpress blog installed in IIS8.5
I have a Wordpress blog installed in a IIS 8.5 machine and I'm using forms authentication using the following:我在 IIS 8.5 机器上安装了一个 Wordpress 博客,我正在使用以下形式的表单身份验证:
<authentication mode="Forms">
<forms loginUrl="/login/login.aspx" name="authcookies" protection="All" timeout="30" path="/">
</forms>
</authentication>
I also have:我也有:
<authorization>
<deny users="?" />
</authorization>
to prevent unauthenticated users from accessing the blog.防止未经身份验证的用户访问博客。
When I try to access www.test.com/blog
when I'm unauthenticated it redirects me to the login page but if I go to www.test.com/blog/subdir
it ignores the authentication.当我在未经身份验证的情况下尝试访问
www.test.com/blog
时,它会将我重定向到登录页面,但如果我转到www.test.com/blog/subdir
它会忽略身份验证。
Any ideas?有任何想法吗?
You will need to add a handler to force IIS to run requests for php pages through the .net authorisation pipeline.您将需要添加一个处理程序以强制 IIS 通过 .net 授权管道运行对 php 页面的请求。 Add this to the web.config inside the /blog directory:
将此添加到 /blog 目录中的 web.config 中:
<handlers>
<add name="phpauth" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
</handlers>
Make sure the preCondition matches the bitness and runtime version of your app pool确保 preCondition 与应用程序池的位数和运行时版本相匹配
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.