简体   繁体   中英

How to convert a .htaccess to a web.config file

I am trying to change this to a web.config file but I am failing:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [PT,L]

To convert .htaccess rule into web.config first you need to install the URL rewrite module in iis.you could download it from the below link:

https://www.iis.net/downloads/microsoft/url-rewrite

Then after import htaccess rule in iis:

1)open iis manager.

2)double click on URL rewrite module.

3)Click on import rule from the action pane:

在此处输入图像描述

4)paste your rule in rewrite rule box:

5)click apply.

在此处输入图像描述

https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/importing-apache-modrewrite-rules

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM