Rewrite WordPress

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
(New page: === WEB-INF/resin-web.xml === <web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin"> <resin:Dispatch> <resin:IfFileExists/> ...)
 
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 +
[[Category: Rewrite]]
 +
 +
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 &lt;resin:IfFileExists/> condition for the passthrough, and a &lt;resin:Forward> with a target for the rewrite.
 +
 
=== WEB-INF/resin-web.xml ===
 
=== WEB-INF/resin-web.xml ===
  
Line 8: Line 14:
 
   &lt;/resin:Dispatch>
 
   &lt;/resin:Dispatch>
 
   
 
   
   &lt;resin:Forward regexp="^" target='/index.php'/>
+
   &lt;resin:Forward regexp="^" target="/index.php"/>
 
   
 
   
 
  &lt;/web-app>
 
  &lt;/web-app>

Latest revision as of 23:50, 4 May 2009


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