Jump to content

IIS probleme lien url simplifiée image web.config url rewrite


Recommended Posts

Bonjour

Je n'arrive pas à faire fonctionner les url simplifiées dans prestashop v1.5.3.1 sur un serveur IIS 7.5

version prestashop 1.5.3.1 (installé dans le dossier /prestashop/ )
serveur IIS 7.5 sur win 7
le module de ré écriture d'url pour iis installé  http://www.iis.net/d...oft/url-rewrite
url simplifiée activé dans prestashop (.htaccess existe)
web.config modifié

Les liens d'url simplifiés fonctionnent (accès produits + catégories OK)
par contre aucune image n'est visible, je pense que cela provient d'une règle de redirection d'url concernant les images

voici un extrait de mon web.config
 

<rewrite>
            <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^api/?(.*)$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/webservice/dispatcher.php?url={R:1}" appendQueryString="true" />
                </rule>
                <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}-{R:2}{R:3}{R:4}.jpg" logRewrittenUrl="true" />
                </rule>
                <rule name="Imported Rule 3" stopProcessing="true">
                    <match url="^([0-9]+)\-([0-9]+)(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}-{R:2}{R:3}.jpg" />
                </rule>
                <rule name="Imported Rule 4" stopProcessing="true">
                    <match url="^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}/{R:1}{R:2}{R:3}.jpg" />
                </rule>
                <rule name="Imported Rule 5" stopProcessing="true">
                    <match url="^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}/{R:2}/{R:1}{R:2}{R:3}{R:4}.jpg" />
                </rule>
                <rule name="Imported Rule 6" stopProcessing="true">
                    <match url="^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}/{R:2}/{R:3}/{R:1}{R:2}{R:3}{R:4}{R:5}.jpg" />
                </rule>
                <rule name="Imported Rule 7" stopProcessing="true">
                    <match url="^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}/{R:2}/{R:3}/{R:4}/{R:1}{R:2}{R:3}{R:4}{R:5}{R:6}.jpg" />
                </rule>
                <rule name="Imported Rule 8" stopProcessing="true">
                    <match url="^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}/{R:2}/{R:3}/{R:4}/{R:5}/{R:1}{R:2}{R:3}{R:4}{R:5}{R:6}{R:7}.jpg" />
                </rule>
                <rule name="Imported Rule 9" stopProcessing="true">
                    <match url="^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}/{R:2}/{R:3}/{R:4}/{R:5}/{R:6}/{R:1}{R:2}{R:3}{R:4}{R:5}{R:6}{R:7}{R:8}.jpg" />
                </rule>
                <rule name="Imported Rule 10" stopProcessing="true">
                    <match url="^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}/{R:2}/{R:3}/{R:4}/{R:5}/{R:6}/{R:7}/{R:1}{R:2}{R:3}{R:4}{R:5}{R:6}{R:7}{R:8}{R:9}.jpg" />
                </rule>
                <rule name="Imported Rule 11" stopProcessing="true">
                    <match url="^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/p/{R:1}/{R:2}/{R:3}/{R:4}/{R:5}/{R:6}/{R:7}/{R:8}/{R:1}{R:2}{R:3}{R:4}{R:5}{R:6}{R:7}{R:8}{R:9}{R:1}0.jpg" />
                </rule>
                <rule name="Imported Rule 12" stopProcessing="true">
                    <match url="^c/([0-9]+)(\-[_a-zA-Z0-9-\.*]*)(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/c/{R:1}{R:2}{R:3}.jpg" />
                </rule>
                <rule name="Imported Rule 13" stopProcessing="true">
                    <match url="^c/([a-zA-Z-]+)(-[0-9]+)?/.+\.jpg$" ignoreCase="false" />
                    <action type="Rewrite" url="/prestashop/img/c/{R:1}{R:2}.jpg" />
                </rule>
                
                <rule name="Imported Rule 14" stopProcessing="true">
                     <match url="^.*$" />
                     <conditions logicalGrouping="MatchAny">
                         <add input="{REQUEST_FILENAME}" matchType="IsFile" pattern="" ignoreCase="false" />
                         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" pattern="" ignoreCase="false" />
                     </conditions>
                     <action type="None" />
                 </rule>
                 <rule name="Imported Rule 15" stopProcessing="true">
                    <match url="^.*$" />
                     <action type="Rewrite" url="/prestashop/index.php" />
                </rule>
                
            </rules>
        </rewrite>

voici un lien d'image qui pose problème

<img width="124" height="124" alt="" src="http://localhost:83/prestashop/15-home_default/ipod-nano.jpg">

un lien de produit ok

http://localhost:83/prestashop/musique-ipods/1-ipod-nano.html

Comment modifier le web.config pour que les images soient affichées ?

 

Merci d'avance

@+

Edited by isodynwolff (see edit history)
  • Like 1
Link to comment
Share on other sites

Pour contourner le problème lié au images

 

désactivation de la vérification des modules

usage url image normale

 

classes/Tools.php

public static function apacheModExists($name)
{
		return true;

classes/Link.php

	public function getImageLink($name, $ids, $type = null)
	{
		....
		$uri_path = _THEME_PROD_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').$theme.'.jpg';
		
		return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path;
	}

Edited by isodynwolff (see edit history)
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...