2010-12-09 18 views
10

J'utilise WordPress sur Windows 7 IIS pour développer. Je télécharge des images dans WordPress pour un article de blog. L'image affiche bien sur le site Web, mais dès que je permets permaliens les images ne fonctionnent plus et les images futures téléchargées je reviens une erreur:Wordpress permalinks sur IIS?

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

Je ne sais pas pourquoi cela se passe, voici mon 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> 

dès que j'éteins mon permaliens et utilise la valeur par défaut il fonctionne, personne ne sait pourquoi cela pourrait être?

+0

Merci beaucoup cela m'a aidé! cherchait partout url rewrite issue – SirG

Répondre

1

Il existe un web.config légèrement différent à Using Permalinks « WordPress Codex ainsi que d'autres options pour les liens permanents sans réécriture mod sur Windows.

+0

Salut songdogtech, merci pour le lien. Ce sont les documents que j'ai suivis, j'ai réessayé et toujours pas de chance:/Avez-vous d'autres suggestions? –

+0

Nevermind je l'ai réparé. Il s'avère que IIS n'avait pas les permissions, j'ai suivi ceci: http://www.tech-problems.com/http-error-500-50-url-rewrite-module-error-wordpress-images/ et cela a très bien fonctionné ! –

+0

Je pense que le codex WordPress est faux. Le 'web.config' que @JeffTaggarty a travaillé pour moi mais pas celui de WordPress. Il est également en désaccord avec la [documentation d'IIS.net] (http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress) – icc97

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

ne corrige pas les fichiers déjà téléchargés mais l'astuce C: \ inetpub \ temp \ uploads a bien fonctionné. Assurez-vous de définir les autorisations correctes sur inetpub \ temp \ uploads. Tous les nouveaux téléchargements de la bibliothèque multimédia n'obtiennent plus le 500.50 après avoir modifié php.ini et redémarré le serveur Web. – NeuroScr

0

utiliser cette mention ci-dessous dans RÈGLES votre web.config fichier ..

<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>