Issues with URL rewriting?

Last post 04-07-2009, 1:58 PM by cutechat. 28 replies.
Page 1 of 2 (29 items)   1 2 Next >
Sort Posts: Previous Next
  •  01-07-2009, 2:55 AM 47482

    Issues with URL rewriting?

    Are there any know issues with using the UploadAttachments control with a url rewrite module (like the IIS7 rewrite module)? I have a page the works fine when the url rewriting is turned off, but I get a strange 404 error when URL rewriting is turned on. Firebug reports a 404, but the trace logging in IIS reports a 200 status code (OK). Im trying to determine if there is an issue with my rewrite url somehow not handling the request that the control is posting. From looking at the request, it looks fine. Any known issues wth rewriting or tips for where I should look?
     
     
     
     
  •  01-07-2009, 3:47 AM 47484 in reply to 47482

    Re: Issues with URL rewriting?

     
    Here are the IIS trace logs of two requests; one that worked and one that didnt. They are very similar, and I cant see anything that would cause an issue. Thoughts?
     
    CT
  •  01-07-2009, 3:47 AM 47485 in reply to 47482

    Re: Issues with URL rewriting?

    Hi,
     
    Can you post your url configuration?
     
    you need handle the conditions of the querystring which be added by uploader.
     
    Regards,
    Terry
  •  01-07-2009, 4:05 AM 47487 in reply to 47485

    Re: Issues with URL rewriting?

    Here is the rule. The default is that it passes on request parameters.
     
     
            <rule name="Report_Create_Area_Rewrite" stopProcessing="true">
              <match url="^report/create/area/("d+)/?"/>
              <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
              </conditions>
              <action type="Rewrite" url="components/report/create.aspx?areaID={R:1}"/>
            </rule>
     
    To make sure the rule was working I tested the URL bellow and that page loaded properly (however uploading was still broken).
     
    http://localhost/report/create/area/820/?useless=true


    From reading the other posts, my issue seems a bit similar to this one...

    http://cutesoft.net/forums/thread/44779.aspx

    CT
  •  01-07-2009, 4:12 AM 47488 in reply to 47487

    Re: Issues with URL rewriting?

    Hi,
     
    It seems that your are using IIS7 url rewrite module.
     
    I sugguest you keep the querystring like this:
    (maybe you need modify the pattern a little to make it works)
     
    <rule name="Report_Create_Area_Rewrite" stopProcessing="true">
        <match url="^report/create/area/("d+)/?(\?([^\?]*))?"/>
        <conditions>
          <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
          <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
        </conditions>
        <action type="Rewrite" url="components/report/create.aspx?areaID={R:1}&{R:3}"/>
    </rule>
     
    Regards,
    Terry
  •  01-07-2009, 4:15 AM 47489 in reply to 47487

    Re: Issues with URL rewriting?

    One thing Ive noticed from comparing the trace logs is that the failure case doesnt have the correct data for GENERAL_REQUEST_ENTITY. It seems to be missing the form post data somehow.
     
    That sounds like an IIS7 bug very similar to...
     
    http://forums.iis.net/t/1150302.aspx

    http://support.microsoft.com/kb/956578
     
    CT

     
  •  01-07-2009, 4:19 AM 47491 in reply to 47489

    Re: Issues with URL rewriting?

    I tried you suggested regex changes, they did not resolve the issue.
     
    Thanks for trying though!
     
    CT
  •  01-07-2009, 4:27 AM 47492 in reply to 47491

    Re: Issues with URL rewriting?

    Hi,
     
    I just found that the uploader try to access the
     
    components/report/create?areaID=820
     
    That's the problem.
     
    Can you show me the HTML source code ? what is the form action ?
     
    Regards,
    Terry
  •  01-07-2009, 4:30 AM 47493 in reply to 47492

    Re: Issues with URL rewriting?

    Hi,
     
    I think you also need change the pattern
     
    components/report/create
     
    109.
    PATTERN_MATCH
    Pattern="^components/report/create", InputURL="components/report/create", Negate="false", Matched="true"

    Regards,
    Terry
  •  01-07-2009, 4:45 AM 47494 in reply to 47493

    Re: Issues with URL rewriting?

    Hi,
     
    I just checked all logs.. 
     
     
    The form data is OK, the upload module can read it.
     
    after Response.Write("OK") , there is a GENERAL_NOT_SEND_CUSTOM_ERROR
     
    Maybe the error is that , the uploader module do not set Response.StatusCode=200 before Response.Write("OK")
     
    I will create an application and test it in my PC and then give you a response.
     
    Regards,
    Terry
     
  •  01-07-2009, 4:50 AM 47495 in reply to 47493

    Re: Issues with URL rewriting?

     
     
    Here is a clean failure trace.  In it you can see the original url is ...
    report/create/area/820/
     
    this is rewritten to...
     
    components/report/create.aspx?areaID=820
     
    The trace shows this match on line 116.
     
    The final url is...
     
    http://localhost:80/components/report/create.aspx?areaID=820&UseUploadModule=Dynamic&_Namespace=CuteWebUI&_UploadID=ctl00_ctl00_ContentPlaceHolderContent_ContentPlaceHolderContentTrip_ReportEditControl_TabContainer_TabPanelMedia_MediasUploadControl_UploadAttachmentsImage_1231324875429_1&_UploadControlID=ctl00$ctl00$ContentPlaceHolderContent$ContentPlaceHolderContentTrip$ReportEditControl$TabContainer$TabPanelMedia$MediasUploadControl$UploadAttachments&ContextValue=!3wEWAWQ5poyVsnBArG6lJ6b7R2A4cKwMqA!2!2&_Addon=upload&_AddonGuid=7d30d6df-3548-4280-9ecf-32276f3ce99b
     
     
    It then goes on to make a request to that url.
     
    So it looks to me the the url rewriting is working fine to this point.
     
    CT
  •  01-07-2009, 5:18 AM 47496 in reply to 47495

    Re: Issues with URL rewriting?

    Interesting you mention the string "OK". That might explain an odd behavior Im seeing. I put the a breakpoint of Application_BeginRequest for both a success and fail case. The content length of the failure case is 2 bytes less than the success case (for the same image).
     
  •  01-07-2009, 6:43 AM 47497 in reply to 47496

    Re: Issues with URL rewriting?

    Do you get other error logs ?
     
    the url of 404 error is .._Addon=verify&.. , but the log you uploaded is .._Addon=upload&..
     
    Regards,
    Terry
  •  01-07-2009, 2:10 PM 47529 in reply to 47497

    Re: Issues with URL rewriting?

     
    These are all of the trace logs for a failed request.
  •  01-07-2009, 2:24 PM 47530 in reply to 47529

    Re: Issues with URL rewriting?

    Hi,
     
    I have found the reason, and will provide an update in 3-4 days.
     
    In the fr001270.xml, line 128,URL_CHANGED
     
    the UploadModule use request.RawUrl and try to rewrite the url back to NewUrl="/report/create/area/820/?" ,
     
    but the urlwriter module already would not process it, and then the ASP.NET just report NOT FOUND.
     
    Regards,
    Terry
  •  01-07-2009, 2:34 PM 47531 in reply to 47530

    Re: Issues with URL rewriting?

    Woo Hoo!!! I was starting to go a bit crazy trying to figure this one out. Let me know when you have a fix ready; I can test it out for you if you like.
     
    CT
  •  01-08-2009, 9:44 AM 47548 in reply to 47531

    Re: Issues with URL rewriting?

    Hi,
     
    Please download the last version and try again.
     
    Regards,
    Terry
  •  01-08-2009, 11:28 AM 47559 in reply to 47548

    Re: Issues with URL rewriting?

    Dumb question.. where is the latest version? The last one I see was uploaded on 9-28-2008.
     
    CT
  •  01-08-2009, 11:42 AM 47560 in reply to 47559

    Re: Issues with URL rewriting?

  •  04-06-2009, 10:06 AM 50808 in reply to 47560

    urgent: URL rewriting not supported

    w/o prejudice
     
    Adam,
     
    I downloaded your latest version today.
     
    Every directory in your zip  seems to have a different date on the dll contained within, but the most recent seems to be 02/04/09.
     
    The product cannot deal with url rewriting ---- pas en tous. Notwithstanding the de-facto industry standard that all third party asp.net controls deal nicely with url rewriting.
     
    It appears that you have known of this issue for at least three months and yet have failed to address it adequately.
     
    Please address this immediately. I paid 400.00 for this product and if it cannot play nicely with the other kids in the playground I will demand a refund.
     
    I should not have to get into specifics, but, for the application at hand, I redirect all directories, but not files with an extension.
     
    Thanks, Stuart Wachsberg
Page 1 of 2 (29 items)   1 2 Next >
View as RSS news feed in XML