Loosing POST data with ISAPIRewrite
22 posts
• Page 1 of 2 • 1, 2
Loosing POST data with ISAPIRewrite
Hello, i have a problem with loosing POST data after rewriting url (not redirecting).
The httpd.conf looks like this:
On the server side in ASPX codebehind the FORMS collection with post-data is empty. Without rewriting, when i am on url '/en/pages/default.aspx', everything works fine. The server is IIS7.
What's worse, everything is working fine on my local development machine (also IIS7). So my guess is, that the problem is related to some ISAPIREWRITE-IIS7-someKB issue. Anybody can help?
The httpd.conf looks like this:
- Code: Select all
RewriteLog "C:\Program Files\Helicon\ISAPI_Rewrite3\Rewrite.log"
RewriteLogLevel 9
RewriteEngine On
RewriteRule ^/en$ /en/pages/default.aspx [L]
On the server side in ASPX codebehind the FORMS collection with post-data is empty. Without rewriting, when i am on url '/en/pages/default.aspx', everything works fine. The server is IIS7.
What's worse, everything is working fine on my local development machine (also IIS7). So my guess is, that the problem is related to some ISAPIREWRITE-IIS7-someKB issue. Anybody can help?
Re: Loosing POST data with ISAPIRewrite
Hello,
Could you check how configurations of the test server and prod server are different (e.g. different .NET settings).
And also show rewrite.log for the prod machine.
Could you check how configurations of the test server and prod server are different (e.g. different .NET settings).
And also show rewrite.log for the prod machine.
Re: Loosing POST data with ISAPIRewrite
The logfile looks pretty straightforward. Please ignore the map lookup, it works the same way with simple rewrite rule.
What specific settings could be interesting related to this issue? Both environments are windows server 2008, IIS7, .Net 3.5
- Code: Select all
xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx Thu, 30-Aug-2012 09:44:08 GMT [www.mydomain.com/sid#290191491][rid#339590712/initial] (2) init rewrite engine with requested uri /en
xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx Thu, 30-Aug-2012 09:44:08 GMT [www.mydomain.com/sid#290191491][rid#339590712/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx Thu, 30-Aug-2012 09:44:08 GMT [www.mydomain.com/sid#290191491][rid#339590712/initial] (3) applying pattern '^(.*)$' to uri '/en'
xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx Thu, 30-Aug-2012 09:44:08 GMT [www.mydomain.com/sid#290191491][rid#339590712/initial] (5) map lookup OK: map=k[txt] key=/en -> val=/en/pages/homepage.aspx
xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx Thu, 30-Aug-2012 09:44:08 GMT [www.mydomain.com/sid#290191491][rid#339590712/initial] (1) Rewrite URL to >> /en/pages/homepage.aspx
xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx Thu, 30-Aug-2012 09:44:08 GMT [www.mydomain.com/sid#290191491][rid#339590712/initial] (2) rewrite '/en' -> '/en/pages/homepage.aspx'
xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx Thu, 30-Aug-2012 09:44:08 GMT [www.mydomain.com/sid#290191491][rid#339590712/initial] (2) internal redirect with /en/pages/homepage.aspx [INTERNAL REDIRECT]
What specific settings could be interesting related to this issue? Both environments are windows server 2008, IIS7, .Net 3.5
Re: Loosing POST data with ISAPIRewrite
Hello,
thanks for the log. At least we can see that ISAPI_Rewrite is working just as expected.
Could you now provide the Fiddler log for the same request for both test and prod environments.
thanks for the log. At least we can see that ISAPI_Rewrite is working just as expected.
Could you now provide the Fiddler log for the same request for both test and prod environments.
Re: Loosing POST data with ISAPIRewrite
Fiddler details of the requests:
(Sorry for the long lines, i will edit the post later. But you can see, the post data are there, sent to the server.)
DEV:
PROD:
(Sorry for the long lines, i will edit the post later. But you can see, the post data are there, sent to the server.)
DEV:
- Code: Select all
POST http://devmachine/cs HTTP/1.1
Host: devmachine
Connection: keep-alive
Content-Length: 3277
Cache-Control: max-age=0
Origin: http://devmachine
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.83 Safari/537.1
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://devmachine/cs
Accept-Encoding: gzip,deflate,sdch
Accept-Language: cs-CZ,cs;q=0.8
Accept-Charset: windows-1250,utf-8;q=0.7,*;q=0.3
MSOWebPartPage_PostbackSource=&MSOTlPn_SelectedWpId=3
PROD:
- Code: Select all
POST http://prodmachine/cs HTTP/1.1
Accept: image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, */*
Referer: http://prodmachine/cs
Accept-Language: en-us,cs;q=0.5
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: prodmachine
Content-Length: 4688
Connection: Keep-Alive
Pragma: no-cache
MSOWebPartPage_PostbackSource=&MSOTlPn_SelectedWpId=2&ctl00%24ctl00%24buttonSearch.y=12
Last edited by lko on 03 Sep 2012, 07:50, edited 1 time in total.
Re: Loosing POST data with ISAPIRewrite
Hello,
thanks for the Fiddler logs. Still unclear...
Could you create a test PHP page and make the POST request to it (via ISAPI_Rewrite - you'll need to write a rule for it of course) and see if it will work. Then report us the result.
thanks for the Fiddler logs. Still unclear...
Could you create a test PHP page and make the POST request to it (via ISAPI_Rewrite - you'll need to write a rule for it of course) and see if it will work. Then report us the result.
Re: Loosing POST data with ISAPIRewrite
Still the same results. Simple aspx page..
Creating POST request with fiddler to rewriten url ( /cs/, the foreach is enumerating empty collection (on PROD server).
Creating POST request with fiddler to original url, the foreach is returning correct collection of post data (on PROD server).
Creating POST request with fiddler to both urls on DEV server, the foreach is returning correct collection of post data (on DEV server).
I am suspecting some weird security policy enabled on the production forbidding "something"...
- Code: Select all
<%
foreach (string key in HttpContext.Current.Request.Form.AllKeys)
{
Response.Write(key + " - " + HttpContext.Current.Request.Form[key] + "<br />");
}
%>
Creating POST request with fiddler to rewriten url ( /cs/, the foreach is enumerating empty collection (on PROD server).
Creating POST request with fiddler to original url, the foreach is returning correct collection of post data (on PROD server).
Creating POST request with fiddler to both urls on DEV server, the foreach is returning correct collection of post data (on DEV server).
I am suspecting some weird security policy enabled on the production forbidding "something"...
Re: Loosing POST data with ISAPIRewrite
I'm sorry, but I asked you to test it with PHP page. And that's important. Could you please do it once again with the PHP test page.
Re: Loosing POST data with ISAPIRewrite
I'm sorry, unfortunately we do not have installed PHP extensions on our production win 2008 / iis7 servers :/
Re: Loosing POST data with ISAPIRewrite
But you are right, problem is somewhere in my asp.net pipeline, on the beginrequest event the data are still there. Thank you very much for your help and time, now it's up to me.
Re: Loosing POST data with ISAPIRewrite
On the other hand, there is somethnig interesting in the diagnostic log. It seems there is some kind of second "child" request creating (line 124), which is POST too, but of course without the post data. Wth does the "GENERAL_CHILD_REQUEST_START" event mean?
http://www.sdilej.eu/pics/433d8cdd19563 ... c8c78e.png
http://www.sdilej.eu/pics/433d8cdd19563 ... c8c78e.png
Re: Loosing POST data with ISAPIRewrite
Hello,
ISAPI_Rewrite can not initiate such event as GENERAL_CHILD_REQUEST_START by design.
.NET can do that if you have wildcard mapping. Please check.
ISAPI_Rewrite can not initiate such event as GENERAL_CHILD_REQUEST_START by design.
.NET can do that if you have wildcard mapping. Please check.
Re: Loosing POST data with ISAPIRewrite
Sure, i understand that. The only wildcard handler mappings we have look like this:
Last edited by lko on 06 Sep 2012, 08:01, edited 1 time in total.
Re: Loosing POST data with ISAPIRewrite
Please try to temporarily remove these 3 mappings saying ExtensionlessUrlHandler...
They might interfere.
They might interfere.
Re: Loosing POST data with ISAPIRewrite
Still no luck, result is the same. But i compared the handlers on my dev machine, and the handlers are there too.
Pool is running under .NET 2.0.
Pool is running under .NET 2.0.
Re: Loosing POST data with ISAPIRewrite
Hello,
Ok, then these handlers are not the case.
Can you try to disable ISAPI_Rewrite or comment out all RewriteRules and check if the POST data will not be lost.
Also, consider using wFretch to see what happens to your request, that no redirects happen etc.
Ok, then these handlers are not the case.
Can you try to disable ISAPI_Rewrite or comment out all RewriteRules and check if the POST data will not be lost.
Also, consider using wFretch to see what happens to your request, that no redirects happen etc.
Re: Loosing POST data with ISAPIRewrite
Yes, without ISAPI_Rewrite everything works fine. Even with enabled ISAPI_Rewrite, but accessing the original url, everything is OK.
I will have a look into Wfetch, thnak you for the tip.
Edit: It looks similar to fiddler, which can display client-server communication, but my problem lies in the server pipeline - what and why is it causing the childrequest.
I will have a look into Wfetch, thnak you for the tip.
Edit: It looks similar to fiddler, which can display client-server communication, but my problem lies in the server pipeline - what and why is it causing the childrequest.
Re: Loosing POST data with ISAPIRewrite
Hello,
Could you please try to disable the DefaultDocument module in IIS. And try again.
Could you please try to disable the DefaultDocument module in IIS. And try again.
Re: Loosing POST data with ISAPIRewrite
We have removed the DefaultDocumentModule and the server started throwing Internal Server Error exception. IMHO removing the module cannot help.
Re: Loosing POST data with ISAPIRewrite
Hello, dka
Could you outline your problem in more details and show the rules you apply.
Could you outline your problem in more details and show the rules you apply.
22 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 59 guests