compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (9)

View Page History
h1. URL Rewriting

h2. Apache mod_rewrite
h2. Apache HTTP Server

All examples that follow use mod_rewrite, an official module that comes bundled with Apache. To use it, mod_rewrite must either be included at compile time or enabled as a Dynamic Shared Object (DSO). Please consult the [Apache documentation|http://httpd.apache.org/docs/] for your version for more information.

h3. Rewriting with VirtualHost

Here is a very basic virtual host definition, with the focus being the rewrite rules. These rules direct all requests to index.php, except specified file types (.js, .ico, etc.):

{noformat}
For more information, see Jayson Minard's [Blueprint for PHP Applications: Bootstrapping|http://devzone.zend.com/node/view/id/70].

h2. ISAPI_Rewrite for Microsoft IIS

Use ISAPI_Rewrite when using IIS. Add the following to the httpd.ini:
A rewriting engine does not come standard with IIS. If you haven't done so already, you will have to download and install one.

h3. Rewriting with ISAPI_Rewrite

Helicon Tech produces the established [ISAPI_Rewrite|http://www.isapirewrite.com/] in Full and Lite versions. Currently, Full is $99, while Lite is free; however, Lite constrains you to one {{httpd.ini}} file per server.

To enable rewrite support for Zend Framework, simply add the following to {{httpd.ini}}:

{noformat}
[ISAPI_Rewrite]
To learn more about the ISAPI_Rewrite and its syntax, visit the [ISAPI_Rewrite documentation|http://www.isapirewrite.com/docs].

h3. Rewriting with IIRF

[IIRF|http://cheeso.members.winisp.net/IIRF.aspx] (Ionic's ISAPI Rewrite Filter) is a relative newcomer, having been in development for two years. It supports most of the same features as ISAPI_Rewrite.

For IIRF, do the following:

# Download and extract the files.
# Copy {{IsapiRewrite4.dll}} and {{IsapiRewrite4.ini}} to {{C:\Inetpub\}}.
# Edit {{IsapiRewrite4.ini}} so it contains the following: {noformat}RewriteRule ^(/[^.]+)$ /dispatch.fcgi?$1{noformat}
# From the IIS Control Panel, select "Properties" of "Web Sites".
# Browse to the ISAPI Filters tab and click "Add...", then enter "rewrite" for the filter name.
# Browse to {{C:\Inetpub\}} and double-click {{IsapiRewrite4.dll}}
# Click OK.
# The "rewrite" filter should now be listed at the end of the ISAPI filters list.

h2. Lighttpd