WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Exclude Directories in Rewrite web.config Windows iis (2 posts)

  1. likemindsdesigns
    Member
    Posted 1 year ago #

    Help! I have a client who is hosting on their own web server, with Windows iis. I have no familiarity with this Windows platform.

    There are two folders in the root that need to be excluded from the WordPress rewrite rule.

    How can I edit my web.config rewrite so that it excludes those two folders? This is my web.config code below. I assume that the * needs to have some statement to exclude 'clients' and exclude 'portal'.

    <configuration>
    	<system.webServer>
    		<rewrite>
    			<rules>
    				<rule name="wordpress" patternSyntax="Wildcard">
    				<match url="*" ignoreCase="false" />
    						<conditions>
    							<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    							<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    						</conditions>
    					<action type="Rewrite" url="index.php" />
    				</rule>
    			</rules>
    		</rewrite>
    	</system.webServer>
    </configuration>
  2. likemindsdesigns
    Member
    Posted 1 year ago #

    If this helps anyone else, I was able to cobble something together from viewing other web.config edits

    <configuration>
    	<system.webServer>
    		<rewrite>
    			<rules>
    				<rule name="wordpress" patternSyntax="Wildcard">
    				<match url="*" ignoreCase="false" />
    						<conditions>
    							<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    							<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    							<add input="{REQUEST_URI}" pattern="^/(portal|patient)" negate="true" />
    						</conditions>
    					<action type="Rewrite" url="index.php" />
    				</rule>
    			</rules>
    		</rewrite>
    	</system.webServer>
    </configuration>

    This one line (below) is the only change, where "portal" and "patient" are the names of my exclusion folders. I THINK this is working, but I would appreciate input from anyone who has experience with this type of code.

    <add input="{REQUEST_URI}" pattern="^/(portal|patient)" negate="true" />

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.