Solved

url rewrite not working

Posted on 2014-07-30
2
292 Views
Last Modified: 2014-08-08
Any idea why this rewrite it not working
 <rule name="app" stopProcessing="true">
                    <match url="^app$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="safety-app/?e=poster" />
                </rule>

Open in new window


if you go to http://www.kars4kids.org/app
the query parameter doesn't come along.

Why doesn't this work?

If you go into the folder itself.
http://www.kars4kids.org/app/ 

I don't want any query parameters here. this one works.
if someone gets into the folder itself this is the rule

 <location path="index.asp">
        <system.webServer>
            <httpRedirect enabled="true" destination="http://www.kars4kids.org/safety-app/" httpResponseStatus="Permanent" />
        </system.webServer>
    </location>

Open in new window


in the safety app folder itself, i have a redirect only for the index page
        <rewrite>
            <rules>
                <rule name="safety index" stopProcessing="true">
                    <match url="index.asp" />
                    <action type="Redirect" url="http://www.kars4kids.org/safety-app/$S$Q" />
                </rule>
            </rules>
        </rewrite>

Open in new window

0
Comment
Question by:rivkamak
  • 2
2 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 40231273
I am better at Regular Expressions than using them for URL rewriting so that is what I look at first.  Try removing the $ character in

<match url="^app$" />

so your new line is

<match url="^app" />

If that doesn't work please clarify what you are getting and what the rewritten result should look like.  The action in that first block of code hard codes the query string so I am not sure how the original URL matters.  Please clarify that also, if the suggestion above doesn't fix your problem.

bol
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 40231285
One other thing, the server should work with

<action type="Rewrite" url="safety-app/" appendQueryString="True"/>

Notice the new attribute.  If you used the GUI to set up the rule and action then there is a checkbox for "Append Query String" that would also set it to true.

Also notice I removed the query string in your action.  I believe you will have an issue if you provide a query string in the URL value AND have appendQueryString set to True.

bol
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Registering DLL 5 43
How to do advance search in Windows 2008? 11 37
RSOP Red "X" 7 26
Resizing C: in windows server 2008R2 4 27
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

912 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now