Convert htaccess rule to config.web on windows server

Rate this post

I need to use this rule on a Plesk Windows server.

RewriteCond %{REQUEST_URI} ^\/(invoice|offer)\/(.*) [NC]
RewriteRule ^(.*)$$1 [R=301,NC,L]

Can someone show me how to use this rule in the web.conf file?



The resulting web.config should look similar to this:

<?xml version="1.0" encoding="UTF-8"?>
                <rule name="Rule 1" stopProcessing="true">
                    <match url="^(.*)$"/>
                        <add input="{URL}" pattern="^\/(invoice|offer)\/(.*)"/>
                    <action type="Redirect" redirectType="Permanent" url="{R:1}"/>

Leave a Reply

Your email address will not be published.

Back to top button