IIS上的Wordpress永久链接?
我在Windows 7 IIS上使用WordPress进行开发。我在WordPress上传图片以获得博客文章。图像显示在网站上不错,但只要我能永久链接不再工作和今后的任何图片上传的图片我回来了一个错误:IIS上的Wordpress永久链接?
HTTP Error 500.50 - URL Rewrite Module Error.
The page cannot be displayed because an internal server error has occurred.
我不知道为什么会发生,这里是我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>
当我关掉我的永久链接,并使用它的工作原理默认情况下,没有人知道这可能是为什么?
在Using Permalinks « WordPress Codex有一个稍微不同的web.config以及在Windows上没有mod重写的固定链接的其他选项。
嗨songdogtech,感谢您的链接。那是我一直遵循的文档,我重试了,仍然没有运气:/您有任何其他建议吗? – 2010-12-10 14:17:33
没关系我修好了。原来IIS没有权限,我跟着这个:http://www.tech-problems.com/http-error-500-50-url-rewrite-module-error-wordpress-images/它工作得很好! – 2010-12-10 14:23:52
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.
- Change the permissions on the temp folder giving IIS_IUSRS write/modify.
- Change the path of the temp folder in the PHP.ini file to a folder that does have IIS_IUSRS write/modify permission.
Here is a good source detailing the problem: http://www.howyoudo.info/index.php/how-to-fix-windows-server-upload-file-inherit-permissions-error/
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.
使用这个下面提及的规则文件..
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^index\.php$" ignoreCase="false"/>
<action type="None"/>
</rule>
<rule name="Redirect Image to HTTP" stopProcessing="true">
<match url=".*\.(gif|jpg|jpeg|png|css|js)$" ignoreCase="true"/>
<action type="Rewrite" url="{R:0}"/>
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="." ignoreCase="false"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true"/>
</conditions>
<action type="Rewrite" url="/index.php"/>
</rule>
非常感谢这帮了我!到处寻找URL重写问题 – SirG 2011-03-30 02:02:02