IIS上的Wordpress永久链接? [英] Wordpress permalinks on IIS?

查看:91
本文介绍了IIS上的Wordpress永久链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 7 IIS上使用WordPress进行开发.我正在WordPress中上传图片以撰写博客文章.该图像在网站上显示正常,但是一旦启用永久链接,这些图像将不再起作用,并且以后上传的任何图像都会返回错误:

I am using WordPress on Windows 7 IIS to develop. I am uploading images in WordPress for a blog post. The image displays fine on the web site but as soon as I enable permalinks the images no longer work and any future images uploaded I get back an error:

HTTP Error 500.50 - URL Rewrite Module Error.
The page cannot be displayed because an internal server error has occurred.

我不确定为什么会这样,这是我的web.config:

I am not sure why this would be happening, here is my web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="wordpress" patternSyntax="Wildcard">
          <match url="*" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

一旦我关闭了永久链接并使用了默认设置,有人知道为什么吗?

As soon as I turn off my permalinks and use the default it works, does anyone know why this could be?

推荐答案

图片问题是权限问题,但只需手动设置即可 原始图像文件或父文件夹上的文件不足.这 WordPress的行为是它使用IUSR写入原始文件 到PHP.ini文件中定义的临时系统目录. 此临时文件夹没有IIS_IUSRS权限,因此当 Windows将此文件从temp文件夹移至应用程序的 上传文件夹,其最终目录IIS_IUSRS仅具有读取权限,因此 权限不会从文件的父文件夹继承.

The image issue was a permission issue, but simply setting it manually on the original image file or parent folder is inadequate. The behavior of WordPress is that it writes the original file using IUSR to a temporary system directory that is defined in the PHP.ini file. This temp folder does not have IIS_IUSRS permissions on it, so when windows moves this file from the temp folder to the application's upload folder, its final home, IIS_IUSRS only has read permissions, so the permissions are not inherited from the file's parent folder.

要解决此问题,有两种解决方案.

To fix this, there are two solutions.

  1. 更改temp文件夹的权限,以允许IIS_IUSRS写入/修改.
  2. 将PHP.ini文件中的temp文件夹的路径更改为具有IIS_IUSRS写入/修改权限的文件夹.

以下是详细说明问题的好资料: http://www.howyoudo.info /index.php/how-to-fix-windows-server-upload-file-inherit-permissions-error/

Here is a good source detailing the problem: http://www.howyoudo.info/index.php/how-to-fix-windows-server-upload-file-inherit-permissions-error/

我选择将PHP.ini中的temp文件夹移至 C:\ inetpub \ temp \ uploads,并为其授予权限.上传后 wp-admin中的图片,我可以访问该图片(原始图片,而不是 调整大小),而不会出现500.50错误.

I chose to move the temp folder in my PHP.ini to C:\inetpub\temp\uploads and also give it permissions. After uploading an image in wp-admin, I was able to access the image (original, not resized) from a browser wihout the 500.50 error.

来自源文件

这篇关于IIS上的Wordpress永久链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆