?
Solved

url rewrite not working

Posted on 2014-07-30
2
Medium Priority
?
301 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
Suggested Courses

777 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