2010-12-09 2 views
10

Я использую WordPress для Windows 7 IIS для разработки. Я загружаю изображения в WordPress для публикации в блоге. Изображение отображается нормально на веб-сайте, но как только я включаю Permalinks изображения больше не работают, и все последующие изображения не загружено я возвращусь ошибку:Wordpress постоянные ссылки на IIS?

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> 

Как только я выключаю пермалинки и использовать по умолчанию он работает, кто-нибудь знает, почему это может быть?

+0

Большое спасибо, это помогло мне! искал всюду по поводу перезаписи url – SirG 2011-03-30 02:02:02

ответ

1

Существует немного другой web.config по адресу Using Permalinks « WordPress Codex, а также другие возможности для Permalinks без перезаписи мод на Windows.

+0

Привет, songdogtech, спасибо за ссылку. Это были документы, за которыми я следил, я повторил и до сих пор не повезло:/У вас есть другие предложения? – 2010-12-10 14:17:33

+0

Nevermind Я исправил его. Оказывается, у IIS не было разрешений, я последовал этому: http://www.tech-problems.com/http-error-500-50-url-rewrite-module-error-wordpress-images/, и он работал просто отлично ! – 2010-12-10 14:23:52

13

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. Change the permissions on the temp folder giving IIS_IUSRS write/modify.
  2. 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.

From source

0

использовать это ниже упоминания ПРАВИЛ в вашем web.config файл ..

<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> 
Смежные вопросы