Click here to Skip to main content
15,796,456 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using Microsoft URL Rewrite Module and have a problem

1- I need for rewriting to ignore images and css and all other files and directories if possible.
I've tried the following rule but it didn't work
HTML
<rule name="Remove trailing slash" stopprocessing="true">
        <match url="(.*)/$" />
        <conditions>
            <add input="{REQUEST_FILENAME}" matchtype="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchtype="IsDirectory" negate="true" />
        </conditions>
        <action type="Redirect" redirecttype="Permanent" url="{R:1}" />
</rule>



2- I've added the following rule as my images and css files are in a directory with name "Style"

HTML
<rule name="RewriteImages" stopprocessing="true">
        <match url="^Style/(.+)" />
        <action type="Rewrite" url="Style/{R:1}" />
</rule>


It works fine for 0 and 1 level:
domain-name.com
domain-name.com/phrase1


But image is not displayed while using more than one level:
domain-name.com/phrase1
domain-name.com/phrase1/phrase2
domain-name.com/phrase1/phrase2/phrase3
etc.
!!!!


But still the styles in css file is working

Another Question..
Rewriting doesn't work on localhost, I'm using Visual Web Developer Express 2008.


Please help urgently.
Posted
Updated 25-Aug-11 19:11pm
v4
Comments
Ahmad Safwat 25-Aug-11 13:09pm    
heeeeeeeeeey

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900