Rewrite WordPress

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
 
[[Category: Rewrite]]
 
[[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 <resin:IfFileExists/> condition for the passthrough, and a <resin:Forward> with a target for the rewrite.
  
 
=== WEB-INF/resin-web.xml ===
 
=== WEB-INF/resin-web.xml ===
Line 10: Line 14:
 
   </resin:Dispatch>
 
   </resin:Dispatch>
 
   
 
   
   <resin:Forward regexp="^" target='/index.php'/>
+
   <resin:Forward regexp="^" target="/index.php"/>
 
   
 
   
 
  </web-app>
 
  </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