wordpress servlet mapping not working
I have the latest Wordpress running on Tomcat 6.0.26 virtual host with Quercus PHP servlet.
It works, except when I try to use perm links. A url such as /index.php/my-page-name doesn't seem to ever hit the PHP servlet . It gets a browser error that request resource is not available. It's like it isn't matching the servlet urlmapping.
I'm using a standard method in the web.xml
<servlet-mapping>开发者_JAVA百科
<servlet-name>Quercus Servlet</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>
I see nothing showing up either in the Tomcat logs when I use the above URL.
Any ideas please?
This mapping indeed doesn't work well with pathinfo's.
You have 2 options:
Replace suffix-mapping by a prefix-mapping. Put PHP files in a folder, e.g.
/php
and use/php/*
instead of*.php
.Create a
Filter
which dispatches the request to the desiredServlet
when the request URI matches the*.php/*
pattern as well.
精彩评论