Project

General

Profile

help with ISAPI dll on server

Added by Obelix Stone almost 6 years ago

Hello

I have ISAPI dll, because I am on windows. I can run my simple website dll from localhost. I use IIS 7.5.

Problem is, I dont know how to connect my dll in to localhost and act as normal website.

What I did:

  1. I can redirect website in to file mytest1.dll and it will run as expected. Problem with this is, it show mytest1.dll on url. And this is unwanted.
  2. Then I decide to use URL Rewrite. I create Rewrite rule to mytest1.dll with catch pattern for send it to mytest1.dll. It is working until I click on button to change page.
    Then url is rewriten back to the localhost/mytest1.dll/page2 from localhost/page1. If I dont send pattern in to mytest1.dll, when I change page2 to page1 it is working as expected, but then I cannot link my page2 from outside because it allways begin start page.
    here is my url rewrite setup:
    <rule name="site" enabled="true" stopProcessing="true"> <match url="(.*)" /> <action type="Rewrite" url="mytest2/mytest1.dll/{R:1}" appendQueryString="true" logRewrittenUrl="false" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> </conditions> </rule>

3. I can add mytest1.dll in to Handller Mapings which have similar behavior as URL Rewrite without sending pattern. Difference is, all url to pages are displayed like this: localhost/page1, localhost/page2. From URL Rewrite user can see original path (localhost/mytest1.dll/page2). One strange thing is when I reload page with ctr + F5 and I am on page2, the url stay as is, but application is displayed back to main page and when I click to other page, it show me this localhost/page2/mainpage. This is same for URL Rewrite when I dont send pattern.

Question is, I am on right way, or I am doing it wrong? Which way is correct to set up ISAPI dll on IIS? How can my wt application act like ordinary website?


Replies (5)

RE: help with ISAPI dll on server - Added by Wim Dumon almost 6 years ago

Hey Obelix,

To be honest, we didn't do much testing on this subject. We usually configure a reverse proxy server for this type of operation. Some headers are exchanged that will explain Wt at what URL the application is really deployed, and Wt will take this into account when generating URLs. That's most likely the reason why (2) does not work well - rewrite does not provide such information.

I'm not sure if I understand your third point.

Best regards,

Wim.

RE: help with ISAPI dll on server - Added by Obelix Stone almost 6 years ago

Hi,

Some headers are exchanged that will explain Wt at what URL the application is really deployed, and Wt will take this into account when generating URLs. That's most likely the reason why (2) does not work well - rewrite does not provide such information.

That means, it is Wt problem why is url rewriten back?

3. point is about that, when mytest1.dll is used as Handler Mappings and wildcard is "*", I don't need use URL Rewrite. Simply I load page and Wt is loaded. If I put localhost/page2, Wt app lands on mytest1.dll/page2, but mytest1.dll will be hiden even if I click on page1, url is never rewriten back. This is what I want. Unfortunately I am not able display CSS files and problem is when url is under page2 for example, and I reload website and then click on page1, final url will be localhost/page2/page1 if I repeat reload website (ctrl + F5) and go back to page2, final url will be localhost/page2/page1/page2, etc...

When Wildacrd under Handler Mappings is "something", I must use localhost/something. Then CSS is loaded. WHen page is changed, it working as expected, but problem is, when I pass in to url localhost/somehting/page2 Wt lands on main page. But in my guess, this is because I use wildcard "something" and when I put on url somehting/page1 "/page1" will be ignored, because Wildcard take url input "*" or "word". Word can contain file name or file type and "*" can contain everything which pass in to Wt as url. And I don't know if it is possible to combine wildcards as input and words. When I try use wildcard as "something*" it doesn't help.

RE: help with ISAPI dll on server - Added by Wim Dumon almost 6 years ago

Hi Obelix,

If all paths of your webserver are routed to the wt application dll, it's expected that the CSS files can't be served, since in ISAPI Wt does not serve files itself. Can you write the handler mappings wildcard so that it excludes the directories in which your CSS files reside?

With respect to the paths growing from localhost/page2/page1, and the something/page1 not being interpreted correctly by Wt, that's not as intended. Can you check if the parameter AllowPathInfoForScriptMappings can improve the situation: https://msdn.microsoft.com/en-us/library/ms525840(v=vs.90).aspx

Best regards,

Wim.

RE: help with ISAPI dll on server - Added by Obelix Stone over 5 years ago

Unfortunately AllowPathInfoForScriptMappings doesn't resolve the problem.

RE: help with ISAPI dll on server - Added by Roel Standaert over 5 years ago

A customer also ran into a similar problem, caused by the fact that IIS when allowPathInfo is set to false, it will make the SCRIPT_NAME and PATH_INFO server variables the same (the full path). When allowPathInfo is set to true, SCRIPT_NAME is set to the match, and PATH_INFO is set to the part that remains. Of course, when using wildcard matches this will mean that SCRIPT_NAME will contain the full path and PATH_INFO will be empty.

Note that this customer only had that problem with progressive bootstrap. When not using progressive bootstrap, Wt will be a bit smarter about which URLs to use, because it will get the opportunity to run some JavaScript first.

Could you maybe share your handler mappings so I can get a better idea of what you are trying to achieve?

    (1-5/5)