I am converting the rewrite rules from an htaccess file in IIS using the URL Rewriter Module but the following error occurs.
This directive was not converted because it is not supported by IIS:
RewriteBase /
The conversion process proceeds when the said line is commented out. My question now is, how can I set the base path in IIS for all the rewrite rules?
2
Answers
Could you share your htaccess rule and what is your requirement?
The RewriteBase is auto-calculated based on where the rule is defined so if you define the rule under the /path in your site, that becomes the base for those rules.
If you want to set rule for specific path select that path from iis server node and add url rewrite for that.
It will create a web.config file in that folder.
You could also refer below post for more detail:
https://forums.iis.net/t/1162790.aspx
Regards,
Jalpa
I suggest you ignore
RewriteBase /
inside.htaccess
becauseweb.config
considers the base URL for the rewrite rules is the current directory /.So for each sub-directory you’ll need a separate
web.config
file.