[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

IIS 8.5 Rewrite issue

Posted on 2014-07-16
5
Medium Priority
?
1,616 Views
Last Modified: 2014-08-02
I am trying to exclude the directory "myrtle-beach-golf-blog"
I have tried these different combinations.  They do not seem to work.  I get a 500 error on both.

 <rule name="rule 1P" stopProcessing="true">
	           <match url="^([a-zA-Z0-9-/]+)$"  />
			   <conditions>
					<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
					<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
					<add input="{REQUEST_URI}" negate="true" pattern="myrtle-beach-golf-blog.*" />
					<add input="{REQUEST_FILENAME}" negate="true" pattern="^myrtle-beach-golf-blog.*" />
				</conditions>
	           <action type="Rewrite" url="/index.cfm?{R:1}"  />
            </rule>

Open in new window


and

 <rule name="rule 1P" stopProcessing="true">
	           <match url="^([a-zA-Z0-9-/]+)$"  />
			   <conditions>
					<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
					<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
				</conditions>
	           <action type="Rewrite" url="/index.cfm?{R:1}"  />
            </rule>

Open in new window


Any ideas on what I am missing here?

Other rewrites are working accordingly...
0
Comment
Question by:rjohnsonjr
  • 2
4 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 40213946
It's ages since I did this, but why don't you just match the directory in the "match-url and action it to index.cfm?
0
 
LVL 34

Assisted Solution

by:Big Monty
Big Monty earned 2000 total points
ID: 40214746
i tested the following rule out on my site and it seems to do what you want, you just need to change the destination to index.cfm:

        <rewrite>
            <rules>
                <rule name="rule1" stopProcessing="true">
                    <match url="myrtle-beach-golf-blog/(.*)" />
                    <action type="Redirect" url="/index.asp" />
                </rule>
            </rules>
        </rewrite>

Open in new window


test link - http://www.exchangetree.org/myrtle-beach-golf-blog/

I'll leave the rule up for a few days, or until you get a chance to test it on your end
0
 
LVL 6

Accepted Solution

by:
rjohnsonjr earned 0 total points
ID: 40225780
Big Monty,
You were correct but with a slight tweak:
<rule name="rule1blog" stopProcessing="true">
                    <match url="myrtle-beach-golf-blog/(.*)" />
                    <action type="Rewrite" url="/index.cfm?{R:1}" />
</rule>

Open in new window

0
 
LVL 6

Author Closing Comment

by:rjohnsonjr
ID: 40235894
My comment was the actual solution but Big Monty got me there.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses
Course of the Month18 days, 10 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question