web.config: Joomla URL Rewrite

Joomla URL Rewrite via web.config.

Vervang of voeg toe aan de web.config:


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <system.webServer>
       <rewrite>
           <rules>
               <rule name="Joomla! Rule 1" stopProcessing="true">
                   <match url="^(.*)$" ignoreCase="false" />
                   <conditions logicalGrouping="MatchAny">
                       <add input="{QUERY_STRING}" pattern="base64_encode[^(]*\([^)]*\)" ignoreCase="false" />
                       <add input="{QUERY_STRING}" pattern="(>|%3C)([^s]*s)+cript.*(&lt;|%3E)" />
                       <add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
                       <add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
                   </conditions>
                   <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
               </rule>
               <rule name="Joomla! Rule 2">
                   <match url="(.*)" ignoreCase="false" />
                   <conditions logicalGrouping="MatchAll">
                     <add input="{URL}" pattern="^/index.php" ignoreCase="true" negate="true" />
                     <add input="{URL}" pattern="/component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$" />
                     <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>
           </rules>
       </rewrite>
        <directoryBrowse enabled="false" />
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="index.htm" />
                <add value="index.html" />
                <add value="iisstart.htm" />
                <add value="default.aspx" />
            </files>
        </defaultDocument>
        <httpErrors errorMode="Detailed" existingResponse="PassThrough" />
   </system.webServer>
</configuration>
























Was dit antwoord nuttig?

 Print dit artikel

Lees ook

web.config: Request filtering

Dit artikel legt uit hoe je filtering kunt toepassen via jouw web.config bestand.Als je het...

Joomla

Plaatste de volgende code in index.php (op de tweede regel na) if...

htaccess: Redirect non-www naar www

Als je je verkeer wilt redirecten van non-www naar www kun je het volgende in je .htaccess...

web.config: Pagekit URL Rewrite

<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer>...

web.config: Prestashop URL rewrite

Om de URL rewrite voor Prestashop toe te passen zijn de volgende stappen noodzakelijk. Login op...