Url rewrite voor PrestaShop (web.config)

Om de URL rewrite voor Prestashop toe te passen zijn de volgende stappen noodzakelijk.
  1. Login op jouw Prestashop Admin en ga vervolgens naar Preferences->SEO & URLs Daarna kun je Yes aanvinken naast Friendly URL.
    Prestashop hosting url rewrite


    Prestashop hosting url rewrite


  2. Kopieër en plak de volgende code in uw web.config bestand. Vervang de volledige inhoud van het bestand.
    Verwijder jouw .htaccess bestand daarna zullen de Friendly URLs werken.

xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^api/?(.*)$" ignoreCase="false" />
<action type="Rewrite" url="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="img/p/{R:1}-{R:2}{R:3}{R:4}.jpg" />
rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="^([0-9]+)-([0-9]+)(-[0-9]+)?/.+.jpg$" ignoreCase="false" />
<action type="Rewrite" url="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="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="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="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="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="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="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="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="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="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="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="index.php" />
rule>
rules>
rewrite>
system.webServer>
configuration>