Attention! Helicon Tech Blog has moved to www.helicontech.com/articles/

Thursday, April 22, 2010

Titbits: Making Ape work with Plesk 9.5.1

If you have Ape and Plesk installed on your server, you may come across the issue that Ape is not working it it's entirity. This may be caused by the fact that Plesk overrides the handlers list for each domain it creates. Like this:
<location path="Example.com">
        <system.webServer>
            <handlers accessPolicy="Read, Script">
                <clear />
                <add name="Plesk_Handler_05171048" path="*.dll" verb="*" 
                    modules="IsapiModule" resourceType="File" 
                    requireAccess="Execute" allowPathInfo="true" />
                <add name="Plesk_Handler_05171080" path="*.exe" verb="*" 
                    modules="CgiModule" resourceType="File" 
                    requireAccess="Execute" allowPathInfo="true" />
                <add name="StaticFile" path="*" verb="*"
                    modules="StaticFileModule,DefaultDocumentModule,
                    DirectoryListingModule" resourceType="Either" />
            </handlers>
            ...
    </location>
To add handler for Helicon Ape, you need to add this simple spell to the root web.config for the site:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
 
    <handlers>
      <add name="Helicon.Ape Handler" path="*.apehandler" verb="*" 
          type="Helicon.Ape.Handler" resourceType="Unspecified" 
          preCondition="integratedMode" />
    </handlers>

  </system.webServer>
</configuration>

Guess, this small hint will make Plesk and Ape cohabitation on your server more peaceful.

Best regards,
Sergey, Anton - Helicon Tech Team

Wednesday, March 31, 2010

Titbits: Disabled ASP.NET handler prevents Ape from working

There have always been problems with any kind of software, when the software itself is installed correctly but doesn’t seem to work.

The same problem occured with Helicon Ape while installing on Windows Server 2003, IIS6. User had full control of config files and was able to browse the sites in IIS, but not a single rule took effect.

Investigation of the problem led us to IIS Manager/Web Service Extensions. The ASP.NET handler was disabled, which was completely blocking Helicon Ape operation.

The reason is that Ape is an ASP.NET module which can’t be run with appropriate handler “prohibited”.

One look is all it takes to find a solution to the issue – press “Allow” button for ASP.NET in Web Service Extensions:


Best regards,
Andrew & Anton, Helicon Tech Team

Thursday, March 18, 2010

ISAPI_Rewrite3 vs LinkFreeze - which is better?

From time to time we get the questions of this kind on our forum/email, so I guess it's time to show the difference to everyone.
  1. Ease of use
    LinkFreeze is the unquestionable leader by this parameter. One dialog is everything you'll deal with - all settings are set up there.

    ISAPI_Rewrite in its turn is far more complex tool - you need to be aware of (at least) the basics of regular expressions to manage it. Most of the configuration is stored in plain text files which may be edited in a special manager.


  2. Functionality
    In this characteristic the situation is quite the contrary - ISAPI_Rewrite has incomparably more features than LinkFreeze, notably:
    - rewriting URLs in any way you want (e.g. having www.domain.com/seo_page-123.html refer to www.domain.com/real_page.aspx?param_id=123);
    - proxying (e.g. having www.external.com/any_page.html refer to www.internal.com/any_page.aspx);
    - mapfiles support (e.g. having www.domain.com/seo_page-param_name.html refer to www.domain.com/real_page.aspx?param_id=123);
    - filtering requests based on server variables' values, IP addresses/domain names, referers, etc.

    LinkFreeze is achieving SEO-friendliness in a different way - it allows to make query string a part of the URL, move and change file extension (e.g. having www.domain.com/page_name-param_name-123.html refer to www.domain.com/page_name.aspx?param_name=123) but the wording of the URL remains intact (addition/replacement/deletion of URL portions is not possible).

  3. SEO efficiency
    While LinkFreeze will automatically make your links on pages look like www.domain.com/page_name-param_name-123.html, with ISAPI_Rewrite3 you need to either alter them manually to look like www.domain.com/seo_page-param_name.html or use 301 redirects (this may slightly decrease the pagerank of the page) to SEO-friendly page names and reverse internal rewriting to the actual page name. Here's how it looks like in terms of ISAPI_Rewrite 3 syntax:
    RewriteEngine on
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^param_id=(\d+)$ 
    RewriteRule ^real_page\.aspx$ seo_page-%1.html? [NC,R=301,L] 
    RewriteRule ^seo_page-(\d+)$ real_page.aspx?param_id=$1 [NC,L]
    So, the key difference is that LinkFreeze changes links on pages and ISAPI_Rewrite doesn't!

  4. Windows versions supported
    LinkFreeze supports Windows NT 4 (IIS 4), Windows 2000 (IIS 5), Windows XP (IIS 5.1) and Windows 2003 (IIS 6).

    ISAPI_Rewrite3 supports Windows 2000 (IIS 5), Windows XP (IIS 5.1), Windows 2003 (IIS 6), Windows Vista (IIS 7), Windows 2008 (IIS 7), Windows 7 (IIS 7.5) and Windows 2008 R2 (IIS 7.5).

    If you are the lucky user of IIS7 (7.5) and need ISAPI_Rewrite/LinkFreeze capabilities, you can benefit from using Helicon Ape tool which includes mod_rewrite and mod_linkfreeze as well as a bunch of other helpful modules and functions.
Hope this article favored better understanding of the products capabilities and peculiarities, and you choice will be more conscious.

Best regards,
Anton, Helicon Tech

Wednesday, March 10, 2010

Titbits: Plus sign in IIS7

This seems to be a known issue, but I'll cover it once again just in case...

So, after fresh install of IIS7 you are likely to notice that requests containing plus ('+') character are not accepted.
The issue is that by default IIS is set to not accept double escape sequences. Let's fix it.

Open IIS Manager, go to Request Filtering page and open Edit feature settings... dialog.
Now check the Allow double escaping option and press OK.
Note! The same can be set directly in web.config using the following code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <security>
            <requestFiltering allowDoubleEscaping="true" />
        </security>
    </system.webServer>
</configuration>
That done, refresh the page in the browser and you'll have it handled correctly.
Hope you'll find this tip helpful.

Best regards,
Anton, Helicon Tech Team

Thursday, February 25, 2010

Two-digit back-references in ISAPI_Rewrite and Ape

We've planned to implement it for a long time and eventually it's done.

In ISAPI_Rewrite 3.1.0.70 and Ape 3.0.0.32 one can have more than 9 submatches and consequently more than 9 back-references in both RewriteCond and RewriteRule (RewriteProxy, RewriteHeader) statements.

The syntax to address these submatches is illustrated in the following example:
RewriteBase /
RewriteCond %{QUERY_STRING} ^id1=(\d+)&id2=(\d+)&...&id10=(\d+)&id11=(\d+)$
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)...
  .../([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/$
    %1/%2/%3/%4/%5/%6/%7/%8/%9/%%10/%%11?id1=$1&id2=$2&...&id10=$$10&id11=$$11 [L]
Note! This syntax is not supported in Apache.

Note! We highly recommend to avoid rules like that (as they indicate your URLs are not really SEO-friendly), but if there's no other way out, do use it.

We believe this small bit of functionality will save you time and efforts.

Best regards,
Anton, Helicon Tech Team

Tuesday, February 23, 2010

"Zip and save" option in Ape Manager

Hello, everyone!

We want to inform you of a new helpful feature that is available in Helicon Ape 3.0.0.32 and higher.

To make your interaction with our support team more fruitful we've introduced a context menu item "Zip and Save Ape Configuration" that makes an archive including all Ape config files for current location (on which you right-clicked) and its parents, web.config and Ape rewrite and error logs.


Having chosen the option you'll be informed about the files to be included into the package.


Note! All the files taken have proven to be essential for quick/efficient problem solving in most cases.

Notice that you can append additional files to the zip package later.

Finally, you'll be prompted to specify the location for the package to be saved (by default it's Ape installation folder). Our support team will be really grateful to get it for investigation.

We do hope this feature will help our support team resolve your issues within the shorter term.

Best regards,
Anton, Helicon Tech Team

Monday, February 22, 2010

New Helicon Ape 3.0.0.32 released

Hello, everyone.

Good news - we've just released the new build of Helicon Ape - 3.0.0.32.
So, what's new:
  • from now on you can write mod_proxy directives inside .htaccess files (previously only global context was supported);
  • "Zip and save Ape configuration" option in Ape Manager automatically saves and zips all Ape configs and logs for selected location (site, folder) so you could then send them to our support team;
  • bug fix related to processing of long URLs.
Best wishes,
Anton, Helicon Tech Team