Tuesday, September 6, 2011

ISAPI Rewrite 3.0 Lite and IIS 7.5 Problems Bypassed With Microsoft URL Rewrite

I have used both free and purchased licenses of  Helicon Tech's ISAPI Rewrite product for years. The Apache mod_rewrite (httpd / htaccess) syntax took some getting used to, but support staff (especially Anton Yaroslav) are fantastic. The forums are very active and have volumes of answered questions.

Unfortunately, their product's future took a bit of a blow today in my shop when I ran into problems installing ISAPI Rewrite 3.0 Lite (0086) on a 64-bit Windows 2008 R2 Server running IIS 7.5.7600.16385. When I would look at the site using the Helicon ISAPI Manager, it would say:
"No properties available for this node."

I found this thread in the forums:
http://www.helicontech.com/forum/13011-No_properties_available_for_this_node.html

... which addressed this issue for people running version 0069. Support said that the problem was resolved in version 0070, but I was running version 0086 and it still wasn't working. I downloaded 0070 to see if that might help, and it didn't. The final word from Helicon was to buy their $100 APE product because it works better with IIS 7.5. That news sent me Googling for other solutions.

Microsoft URL Rewrite Filter Module

Imagine my surprise when I discovered that Microsoft had a free URL Rewrite product of their own! (It was a relief, but also sad that it might spell the end of my long-standing relationship with Helicon.)

Using Microsoft URL Rewrite

Available here: http://www.iis.net/downloads/microsoft/url-rewrite

This is my first install of URL Rewrite, so I thought I'd create this post as a way to remember what I did.

Once installed, a new icon called "URL Rewrite" will appear in the IIS section of the IIS Manager

image

I want to write a rule in the mod_rewrite syntax that I am familiar with, so double click URL Rewrite, and then click "Import Rules" in the right-side menu to open the mod_rewrite rules dialog.
 image
My goal was to force HTTP to HTTPS for all sites on the server, so I used this mod_rewrite code:
http://forums.iis.net/t/1149780.aspx
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Pasting that code into the "Rewrite rules:" window produced converted rules instantly.

image
Right click on the line and choose "Rename" to rename the rule. (You can also do this after creating the rule.)

On first test, the filter did not appear to be working. The same thread that discussed using mod_rewrite code also covered the problem I was having: http://forums.iis.net/t/1149780.aspx

Under SSL Settings, "Require SSL" has to be unchecked. When it is checked, the http request won't make it to the ISAPI filter to be redirected.
 image
After that, it worked like a charm!

Reference:

Microsoft URL Rewrite Filter Module for IIS 7.x
http://www.iis.net/download/URLRewrite
Apache mod_rewrite home
http://httpd.apache.org/docs/current/mod/mod_rewrite.html
IIS.net "http redirect" thread:
http://forums.iis.net/t/1149780.aspx
IIS.net Configuration Reference: ISAPI Filters
http://www.iis.net/ConfigReference/system.webServer/isapiFilters

Helicon ISAPI Rewrite 3.0 download page (most recent version)
http://www.helicontech.com/download-isapi_rewrite3.htm
Version 0086 x64
http://www.helicontech.com/download/isapi_rewrite/ISAPI_Rewrite3_0086_Lite_x64.msi
Version 0070 x64
http://www.helicontech.com/download/isapi_rewrite/ISAPI_Rewrite3_0070_Lite_x64.msi


Tuesday, August 16, 2011

eWallet: Clearing Recently Used Wallets

This isn't exactly a web development post, but it really bothers me that eWallet has a "Recently Used Wallets" section that doesn't have any sort of aging. After a period of disuse, wallets should fall out of the "Recently Used" category, no?

The Ilium tech support section offers this unhelpful response:
http://www.iliumsoft.com/site/support/kb/idx.php/18/504/article/
image
Uninstalling and reinstalling eWallet?! Give me a break.

On Windows 7, just go to
%localappdata%\Ilium_Software,_Inc\

The only entry should be a single subfolder that has a name like:
eWallet.exe_StrongName_1234567890abcdefghijklmnopqrstuv

Click into that subfolder and you should see folders arranged by version number. Open the most recent.
For example, if you see

image
choose 7.2.0.30586

In the most recent version folder, you will find user.config, which contains (among other things) Recently Used Wallets. The user.config file is an XML document with plain English labels, so it is not hard to navigate. Look for "RecentWallets" and delete the offending string elements.
image

The next time you restart eWallet, the entries will be gone!

Tuesday, August 9, 2011

Notepad++ for ColdFusion

Update 10/30/2013:
The nppColdFusion plug-in no longer works as of Notepad++ 6.x.x. The notepad++ folks changed the way plugins hook into the app. Ben Blumel stopped developing nppColdFusion in May 2012. If you use the installer links and instructions below for the earlier Notepad++ version, everything still works.

I have been a devoted user of Textpad for several years as a quick alternate to Dreamweaver, but have been frustrated lately with its 60+ second load time when using network paths. I was reading an article about Adobe Edge today and noticed a number of people mentioning Notepad++ in the comments, so I decided to check it out. Tweaking it for my needs was not 'out of the box'. So this is a recap of what I did:

Download the following:
Notepad++ 5.9.3
Download Page:http://notepad-plus-plus.org/download/v5.9.3.html
Installer: http://download.tuxfamily.org/notepadplus/5.9.3/npp.5.9.3.Installer.exe

nppColdFusion plug-in (Ben Blumel)
Download Page: https://bitbucket.org/bbluemel/nppcoldfusion/downloads
Archive: https://bitbucket.org/bbluemel/nppcoldfusion/downloads/nppColdFusion-0.7.1.zip

sqlLite dll (Required by nppColdFusion)
Download Page: http://sqlite.org/download.html
Archive: http://sqlite.org/sqlite-dll-win32-x86-3070701.zip

Installation
  • Install Notepad++ (this is straightforward)
  • Extract nppColdFusion.dll from nppColdFusion-0.7.1.zip and place it in the %programfiles%\Notepad++\plugins folder
  • Extract nppColdFusion.db3 and nppColdFusion.xml from nppColdFusion-0.7.1.zip (/Config folder) and place them in the %appdata%\Notepad++\plugins\config folder
  • Extract sqllite3.dll from sqllite-dll-win32-x86-3070701.zip and place it in the %programfiles%\Notepad++ folder
  • Open (or Restart) Notepad++
At this point your Notepad++ installation has ColdFusion code hints and coloring. 

image


...but if you're like me, you might like to see a directory tree on the left.

Configuration (Directory Tree)
  • Click [Plugins] --> [Plugin Manager] --> [Show Plugin Manager]
    • If you are behind a proxy, open a CMD.exe window as administrator and execute the following:
      • C:\Program Files (x86)\Notepad++\updater\gup -options
    • Enter proxy and port information and click [Ok]
    • In Plugin Manager, click settings. 
    • For authenticating proxy, enter proxy address in the format: username:password@proxyaddress and click [OK]
  • Scroll down to "Explorer" and check it. Click [Install]
  • When prompted, click [Ok] to restart Notepad++. When Notepad++ comes up, the file tree is hidden by default.
  • Click [Plugins]. Notice that [Explorer] is now an option
image
  • Click [Plugins]-->[Explorer]-->[Explorer...] and the file tree appearsimage

Enjoy!