• View Communities
    • Citrix Developer Network
      The place for unfiltered straight talk on Citrix products. Blogs, code downloads, best practices, APIs, and more can all be found here.
    • Citrix Ready Community Verified
      Does it work with Citrix? Application compatibility questions are a thing of the past with the new Citrix Community Verified site.
    • Blogs
      Learn the latest from the Citrix employees who are building application delivery infrastructure technologies.
    • Blogosphere
      The Citrix Blogosphere is a window into the thousands of conversations taking place about Citrix and Application Delivery.
  •  Sign In
NetScaler Developer Network

Rewrite Policy - Downgrading to HTTP 1.0

This article describes how to use a Rewrite rule to force a web server to send responses as HTML 1.0 rather than HTML 1.1. This disables response chunking and allows Rewrite rules to be used on the response HTML.

Summary

In the NetScaler 8.0 and 8.1 releases, the Rewrite feature cannot perform rewrites on the HTML body portion of chunked HTTP 1.1 responses. To use body Rewrite on HTTP responses, the responses must not be chunked. There are three ways that users can work around this limitation:

  • Disable chunked responses on the web server.
  • Downgrade web server responses to HTTP 1.0 on the web server.
  • Use a Rewrite rule on requests to modify the HTTP request version from 1.1 to 1.0.

For web sites most of whose pages require body rewriting, the first or second options should provide better performance. For web sites with only a few pages that require body rewriting, however, the third option may be preferable because you can write a policy or policies that apply it only to the necessary web pages.

The procedure below describes how to use a Rewrite rule to modify the HTTP request version.

First, you add the Rewrite action, named act_downgrade_1.0, as shown below:
      > add rewrite action act_downgrade_1.0 replace http.req.version "\"HTTP/1.0\""

Next, you add the Rewrite policy. A simple Rewrite policy that matches all requests, named pol_downgrade_1.0, is shown below:
      > add rewrite policy pol_downgrade_1.0 true act_downgrade_1.0

You can also use Rewrite policies that target only requests for pages on specific web hosts, for pages in specific directories on the web server, or even for specific pages. For example, if you want to rewrite the URLs on all pages returned by the host search.example.com, you could create the following Rewrite policy, named pol_search_downgrade_1.0:
      > add rewrite policy pol_query_downgrade_1.0 "HTTP.REQ.HOSTNAME.SERVER.EQ("search.example.com")" act_downgrade_1.0

Finally, you globally bind the Rewrite policy to put it into effect. The following command binds the simple Rewrite policy, named pol_downgrade_1.0, globally:
      > bind rewrite global pol_downgrade_1.0 1 -type RES_DEFAULT

If you named your Rewrite policy differently, you simply substitute the name of your Rewrite policy for pol_downgrade_1.0.

More Information

Tags

rewrite rewrite Delete
appexpert appexpert Delete
code code Delete
pattern pattern Delete
disable chunked disable chunked Delete
chunked response chunked response Delete
rewrite chunked rewrite chunked Delete
http version http version Delete
http downgrade http downgrade Delete
response chunking response chunking Delete
how to how to Delete
Enter tags to add to this page:
Please wait 
Looking for a tag? Just start typing.
Related Links