Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Redirects breaking http headers Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
fasslej
Newbie
Newbie


Joined: 07 July 2010
Online Status: Offline
Posts: 17
Posted: 07 July 2010 at 1:27pm | IP Logged Quote fasslej

I am using a WebSphere plugin alongside ISAPI Rewrite. There is, according to Helicon Support, issues with version 3 loading before the WAS plugin, so they suggested moving to version 2.

Now, in version 2, my redirects are working correctly, but now rewrites are not working. I have tried default and "New" style rewrites and they both fail. They seem to be breaking the session.

I have removed all other ISAPI filters (ASP and WebSphere) and I'm still getting the same results.

Here are samples of the headers in the broken v2 and the old working v3:

Example Rule: RewriteRule ^/jeremy/$ http\://www.mywebsitename.org [I,RP]

HEADER RESULTS: (notice the location field is missing and the http: URL is being sent as a parameter instead. It appears that URL is not being escaped properly. Also notice how the Pragma header is chopped off, leaving only a ": no-cache". This is really weird.

INCORRECT (using version 2)
--------------------------------------------------------------------------------
HTTP/1.1 301 Moved Permanently
Date: Tue, 06 Jul 2010 23:44:14 GMT
Server: Microsoft-IIS/6.0
http: //www.mywebsitename.org

: no-cache
Content-Type: text/html
Content-Length: 153
Location: http://www.mywebsitename.org

<html><body>The requested resource was moved. It could be found here: <a href="http://www.mywebsitename.org">http://www.mywebsitename.org</a></body></html>
--------------------------------------------------------------------------------


Now here is what it looks like using ASAPI Rewrite 3, which was working correctly for us:

--------------------------------------------------------------------------------
HTTP/1.1 301 Moved Permanently
Date: Tue, 06 Jul 2010 23:51:57 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Location: http://www.mywebsitename.org
Content-Length: 237
Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1><p>The document has moved <a href="http://www.mywebsitename.org">here</a>.</p>
</body></html>
--------------------------


No parse errors in the INI files.

Global INI (also tried without RFStyle New)
--------------------------------------
[ISAPI_Rewrite]
RFStyle New
CacheClockRate 3600
RepeatLimit 32

# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule .*\.isrwhlp / [F,I,O]
--------------------------------------

Site INI
--------------------------------------
[ISAPI_Rewrite]

RewriteCond Host: www\.jeremy\.mywebsitename\.org
RewriteRule (.*) http\://jeremy.mywebsitename.org$1 [I,RP]

RewriteRule ^/jeremy/$ http\://www.mywebsitename.org [I,RP]

RewriteRule ^/test/(.*)/(.*)/(.*)/$ /test/\?action=$1&sitecfg=$2&masterid=$3  [I,L]

--------------------------------------

Note that the rewrites now work properly, but the redirects are broken.
Back to Top View fasslej's Profile Search for other posts by fasslej
 
fasslej
Newbie
Newbie


Joined: 07 July 2010
Online Status: Offline
Posts: 17
Posted: 07 July 2010 at 1:31pm | IP Logged Quote fasslej

Summary for those who dont want to read all the above. My guess is that ISAPI_Rewrite 2 seems to not be escaping the redirect path properly, causing the header to be malformed.
Back to Top View fasslej's Profile Search for other posts by fasslej
 
fasslej
Newbie
Newbie


Joined: 07 July 2010
Online Status: Offline
Posts: 17
Posted: 07 July 2010 at 2:02pm | IP Logged Quote fasslej

Wow, huge fine.

If I put the exact same rules into the global httpd.ini file, they work fine. However, if they are at the site level, they break with the above problems.

Any idea why?
Back to Top View fasslej's Profile Search for other posts by fasslej
 
fasslej
Newbie
Newbie


Joined: 07 July 2010
Online Status: Offline
Posts: 17
Posted: 07 July 2010 at 2:27pm | IP Logged Quote fasslej

This new find only works with the "RFStyle New" on, but still not at the site level.
Back to Top View fasslej's Profile Search for other posts by fasslej
 
horizonm
Newbie
Newbie


Joined: 08 July 2010
Online Status: Offline
Posts: 4
Posted: 08 July 2010 at 6:41pm | IP Logged Quote horizonm

Hey... I've been using ISAPI Rewrite 2.0 for years.  I just installed it on my new server and am having this same exact issue.  It's as though it's not sending all the information.  It works fine with a 302 redirect, just not a RP, 301 redirect.

I'm still digging and I'll let you know if I find anything.  THe server I'm using is a dedicated Windows 2003 Server, Web Edition.  As far as I can tell, that's the only difference between my other server.  This is Web Edition and the others are standard edition.

I host with Godaddy.  I do not use websphere.  I do have a Cisco PIX 501 hardware firewall in front of the machine.  I post this thinking that it might help to find a similarity in configurations.

Back to Top View horizonm's Profile Search for other posts by horizonm
 
fasslej
Newbie
Newbie


Joined: 07 July 2010
Online Status: Offline
Posts: 17
Posted: 08 July 2010 at 6:45pm | IP Logged Quote fasslej

Windows 2003 Server, Standard Edition here.

We have Cisco hardware as well. I believe the Cisco ASA series. Glad to see that I'm not alone at least.
Back to Top View fasslej's Profile Search for other posts by fasslej
 
horizonm
Newbie
Newbie


Joined: 08 July 2010
Online Status: Offline
Posts: 4
Posted: 08 July 2010 at 6:54pm | IP Logged Quote horizonm

here is some more information.  I went to an online tool that tests server headers:

http://www.seoconsultants.com/tools/headers

The results were:

#1 Server Response: http://appmtnphotocomp.org
FollowRedirects=False; Server requested redirection, but sent no new location.

My rewrite rule is:

[ISAPI_Rewrite]

RewriteCond host: (?!^www.appmtnphotocomp.org)(.+)
RewriteRule /(.*) https\://www.appmtnphotocomp.org/$2 [I,RP]

Basically, if the url is not www.appmtnphotocomp.org, redirect to that URL.

This is what is being returned from the server as it appears in Firefox:

cache
Content-Type: text/html
Content-Length: 163
Location: https://www.appmtnphotocomp.org/

<html><body>The requested resource was moved. It could be found here: <a href="https://www.appmtnphotocomp.org/">https://www.appmtnphotocomp.org/</a></body></html>

I've searched the forums and don't see anything that would prevent this from working in 2003 web edition.

Back to Top View horizonm's Profile Search for other posts by horizonm
 
fasslej
Newbie
Newbie


Joined: 07 July 2010
Online Status: Offline
Posts: 17
Posted: 08 July 2010 at 6:57pm | IP Logged Quote fasslej

Yeah, it sure looks like you are having the same thing as me. I haven't heard back from anyone at Helicon yet, but I do have a ticket open. Maybe you should too.
Back to Top View fasslej's Profile Search for other posts by fasslej
 
horizonm
Newbie
Newbie


Joined: 08 July 2010
Online Status: Offline
Posts: 4
Posted: 08 July 2010 at 7:08pm | IP Logged Quote horizonm

I did some further looking around.  On the server that this works on, I have a version of the dll (2,9,0,52) which was created on 6/17/2006.

The new version I installed today is 2,15,0,75 and was created on 6/28/2010.  Perhaps they released a new version and there is something wrong with the [RP] directive.  I'm thinking about replacing the dll from the old server to the new server, but I don't know if it will affect the rwhelper.dll???

Back to Top View horizonm's Profile Search for other posts by horizonm
 
horizonm
Newbie
Newbie


Joined: 08 July 2010
Online Status: Offline
Posts: 4
Posted: 08 July 2010 at 7:19pm | IP Logged Quote horizonm

All right... I found a temporary workaround.  I uninstalled the current version download:

http://www.isapirewrite.com/download/isapi_rwf_x86_0075.msi

Then, I installed an older version (2,12,0,55) from the following URL:

http://www.isapirewrite.com/download/isapi_rwf_x86_0073.msi

and my problem was solved.  Looks like in the latest release something got mixed up in the [RP] directive.

Hope this helps you, and Helicon in trying to fix this.

Joe

Back to Top View horizonm's Profile Search for other posts by horizonm
 
fasslej
Newbie
Newbie


Joined: 07 July 2010
Online Status: Offline
Posts: 17
Posted: 09 July 2010 at 11:29am | IP Logged Quote fasslej

Great work. I'll test right now. This has caused me a lot of headache :)
Back to Top View fasslej's Profile Search for other posts by fasslej
 
fasslej
Newbie
Newbie


Joined: 07 July 2010
Online Status: Offline
Posts: 17
Posted: 09 July 2010 at 11:55am | IP Logged Quote fasslej

horizonm,

You rock. Downgraded and it's working great now!

Now if only I could get version 3 to work with my other plugin I'd be totally happy :P
Back to Top View fasslej's Profile Search for other posts by fasslej
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 8118
Posted: 13 July 2010 at 6:00am | IP Logged Quote Lexey

I have fixed this bug. A fixed version will be available in a few days.
Back to Top View Lexey's Profile Search for other posts by Lexey
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum