Forum Moderators: open

Message Too Old, No Replies

isapi_rewrite beginner question

         

defanjos

12:18 am on Jan 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just installed isapi_rewrite on Windows Server 2003, but I cannot get the filter to work.

I ran the automatic install which installs the filter globally, then I went to a test site and placed the httpd.ini file in the root of the site.

I have the following httpd.ini file:
[ISAPI_Rewrite]
RewriteRule /statepage/(.*)\.asp /statepage.asp\?state=$1 [I]

The way I understand it http*://www.mysite.com/statepage/State/NY.asp will be served by http*://www.mysite.com/statepage.asp?state=NY with that rule - well, nothing happens.

According to isapi_rewrite site, a httpd.parse.error file should be written if an error occurs - no file is written.

I went to IIS Manager > Web Sites> Mysite > Isapi Filters, and added the filter isapi_rewrite
Still the filter does not work.

Can anyone point me in the right direction - thanks.

f00sion

7:22 pm on Jan 14, 2004 (gmt 0)

10+ Year Member



did you use the EnableConfig [SiteID¦"Site name"] directive in the global httpd.ini file?

defanjos

8:26 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



f00sion,

Thanks a lot for your reply :)

did you use the EnableConfig [SiteID¦"Site name"] directive in the global httpd.ini file?

No, I did not
The global httpd.ini file looks like:

[ISAPI_Rewrite]

# 3600 = 1 hour
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]

How do I know the site ID?
Should the site name be sitename.com?

Thanks

defanjos

8:55 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




How do I know the site ID?
Should the site name be sitename.com?

Scrap that, it can be found on the metabase.xml file

pageoneresults

9:21 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



ISAPI Rewrite offers a host of documentation from its web site. They also have a user forum and Yaroslav is very quick to answer any questions you may have. I think f00sion also has the answers if we can get him to give up the information! ;)

P.S. f00sion and I go waaayyy back.

defanjos

9:33 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, I've been to the isapi_rewrite forum, and I tried everything Yoroslav requested, but it still does not work.

Yoroslav has requested (via email) that I give him access to the server to try to fix it, but I am a bit hesitant to do that.

I think the problem has to do with the Ensim Web Appliance which is installed in the server, but I am not sure.

defanjos

9:35 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



F00sion,

I added EnableConfig [MySiteID¦"My Site name"] to the global ini file, but it did not work either.

pageoneresults

9:41 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yaroslav has requested (via email) that I give him access to the server to try to fix it, but I am a bit hesitant to do that.

I can understand your hesitancy. Yaroslav is a nice guy and I doubt very seriously he would do anything to jeopardize the program's integrity and that of his company.

defanjos

9:54 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think I'll go ahead and give him access. I already spent way too much time on this.

f00sion

10:23 pm on Jan 14, 2004 (gmt 0)

10+ Year Member



I added EnableConfig [MySiteID¦"My Site name"] to the global ini file, but it did not work either.

is it written just like that or did you replace the mysiteid and site name with real values?.. the or in the syntax (¦) means you should do one or the other... so if your site is listed as widgets.com in the iis administration your config line should say:
EnableConfig ["widgets.com"]

defanjos

10:32 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



f00sion,

I did replace those with real values, but I did not know it was one or the other.

I did it like, for example:

EnableConfig [9¦"widgets.com"]

I will try:

EnableConfig ["widgets.com"]

Thanks

defanjos

11:13 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It did not work :(

Now the error file had an entry:
Line 13: Unrecognized string: EnableConfig ["widgets.com"]

I tried with SiteID and Name, none worked.
try one: EnableConfig ["widgets.com"]
try two: EnableConfig [9]

Thanks anyway.

plumsauce

12:25 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




I have the following httpd.ini file:
[ISAPI_Rewrite]
RewriteRule /statepage/(.*)\.asp /statepage.asp\?state=$1 [I]

http*://www.mysite.com/statepage/State/NY.asp

i do not know the product in detail, but
in this case would $1 not be "State/NY"?

if it follows normal regexp syntax, then the regexp
part of the rule should be:

/.*\/statepage\/State\/(.*)\.asp/

to extract NY as the string $1

defanjos

4:04 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



plumsauce,

Thanks.

That was just a test rule anyway, I have another one and it still does not work.

f00sion

5:04 am on Jan 15, 2004 (gmt 0)

10+ Year Member



hmmm...and u put it in the global httpd file?

plumsauce: i dont think you have to normally escape / characters...at least I haven't had to in the past...the sample he has there should work. but you are right about the value of $1, it must have just been a typo.

defanjos

5:29 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hmmm...and u put it in the global httpd file?

No, the specific rule for the site was placed on a httpd.ini file in the root directory of the site.

The global one looks like the one on message 3

coffeebean

3:17 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



defanjos,

In my httpd.ini, the EnableConfig directive does not have square brackets around the parameter value. It looks like this:

EnableConfig "mywebsite"

Everything broke when I tested adding square brackets.

defanjos

3:45 pm on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



coffeebean,

Thanks, I tried that.
It does not error now, but the filter still does not work.

coffeebean

4:13 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



A couple things to check:

1) As I understand it, the filter should not be installed both Globally and Locally. Should be either one or the other. So if it appears in the ISAPI Filters tab of Master Properties for the machine, then it should not appear in the same tab at the Website level.

2) Did you see the section entitled, "Special notes for the IIS6" in the ISAPI_Rewrite documentation? This concerns nested application pools. Not sure how Ensim Web Appliance is set up but might be something to check.

defanjos

4:42 pm on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1) The filter is only installed globally.

2) I read that section, unfortunately I am not that familiar with the server inner workings to know exactly what they are talking about.
I also think the culprit of this problem is the Ensim Web Appliance.

I am afraid to make changes, because it might bring the whole server down.

One of the people at isapi_rewrite will check my server - hopefully he'll figure it out.

Thanks

defanjos

8:25 pm on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is working.

Adding the user "Everyone" to httpd.ini security properties, and giving it read permissions fixed the problem.

The fun is just beginning :)