Rewrite WordPress

From Resin 3.0

Revision as of 23:50, 4 May 2009 by Ferg (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


When using WordPress with Quercus, most URLs will be rewritten to the WordPress main index.php page. The WordPress rewriting uses two rules: one rule to passthrough static pages like images, and another rule to rewrite URLs to index.php.

Resin's rewrite uses an <resin:IfFileExists/> condition for the passthrough, and a <resin:Forward> with a target for the rewrite.

WEB-INF/resin-web.xml

<web-app xmlns="http://caucho.com/ns/resin"
            xmlns:resin="urn:java:com.caucho.resin">

  <resin:Dispatch>
    <resin:IfFileExists/>
  </resin:Dispatch>

  <resin:Forward regexp="^" target="/index.php"/>

</web-app>
Personal tools