5

I've seen similar issues but none seem to really correspond to the problem I have now...

I have the IIS7 url-rewrite-module and I'm trying to establish what I believe is "simple" rewrites. Here's what I'm using:

            <rule name="PPConnectDesigner" enabled="true" stopProcessing="true">
                <match url="^en/planetpress_connect_designer/(.*?).(html|htm)$" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                <action type="Rewrite" url="/robohelp/server?area=en&amp;mgr=agm&amp;agt=wsm&amp;wnd=Connect Designer|defaultwindow&amp;tpc=/robohelp/robo/server/en/projects/Connect Designer/Designer/{R:1}.htm&amp;RINoLog28301=T&amp;ctxid=&amp;project=Connect Designer" appendQueryString="true" logRewrittenUrl="false" />
            </rule>

This gives me a 404 error, and the detailed error information has the Handler as StaticFile and the Error Code is 0x80070002 ... however, the Requested URL is the right one, if I just copy it from the error page and paste it in another browser tab, it works fine.

Also, if I change the rule from a Rewrite to a Redirect, it works perfectly!

ADDITIONAL INFO

One thing I realized is that I do have some rules that work with rewrites. And, other than the fact that the ones that work point to files that aren't html (I've got a CSS and some javascript in there) there's only once very clear difference: the ones that don't work are pointing towards an HTML page served by a Tomcat application (specifically, RoboHelp Server). I'm wondering if that's not a relevant point: what if IIS's redirection has trouble seeing a page served by tomcat, whereas my browser has no issue with it?

2 Answers2

1

You may want to check the iis logs. They should tell you what path iis was trying to serve when the 404 happens

Mike
  • 3,462
  • 22
  • 25
  • The log is even more useless than the status page I get while accessing my clean url locally - all it says is that it's a 404 with a timeframe and my user agent. Not really useful. – Évelyne Lachance Jan 26 '14 at 19:00
1

rewrite is internal, within same server, so the server looks for page itself and doesn't ask tomcat to look for it.

always use redirect if you are already making url visible to user

http://forums.iis.net/t/1174487.aspx?How+does+URL+Rewrite+differ+from+HTTP+Redirect+

Atul Gupta
  • 725
  • 1
  • 6
  • 20
  • My goal is to do clean URLs, so doing a rewrite is what I want to do. Note that tomcat itself is on the same local server (but I suppose to mean IIS is a server and Tomcat is also a server, so cross-communication doesn't work). Is there a workaround (even using a different rewrite software) or am I forced to show these ugly, long URLs to my visitors? – Évelyne Lachance Jan 26 '14 at 18:45
  • write redirects from pretty to ugly urls within tomcat, and use pretty urls everywhere in iis. also, you can consider renaming ur tomcat server address from robohelp to help or h or something pretty. – Atul Gupta Jan 28 '14 at 03:14
  • I already have pretty urls working everywhere else where I need them, this problem is *specifically* for tomcat. So basically, my question stands: is there another urlrewrite application that works in this situation? – Évelyne Lachance Jan 28 '14 at 05:07