skip to Main Content

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


  1. 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.

    enter image description here

    It will create a web.config file in that folder.

    enter image description here

    You could also refer below post for more detail:

    https://forums.iis.net/t/1162790.aspx

    Regards,
    Jalpa

    Login or Signup to reply.
  2. I suggest you ignore RewriteBase / inside .htaccess because web.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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search