I'm using IIS-7 and am moving a site over from a linux and apache based server environment. I know web.config does the same job as .htaccess. I'm looking to convert the following lines from my .htaccess file to a web.config file. Where would I begin?
Options +FollowSymlinks
RewriteEngine On
RewriteRule ([A-Za-z0-9/_-]+).(jp(e?)g|gif|png)$ thumb.php?src=../../uploads/default/files/$1.$2&size=160x90
To convert rules from .htaccess to web.config you can use import feature of the IIS URL Rewrite Module:
More info about this feature.
For instance your rules are converted into these ones:
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="([A-Za-z0-9/_-]+).(jp(e?)g|gif|png)$" ignoreCase="false" />
<action type="Rewrite" url="thumb.php?src=../../uploads/default/files/{R:1}.{R:2}&size=160x90" appendQueryString="false" />
</rule>
</rules>
</rewrite>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With