开发者

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:

  1. Replace suffix-mapping by a prefix-mapping. Put PHP files in a folder, e.g. /php and use /php/* instead of *.php.

  2. Create a Filter which dispatches the request to the desired Servlet when the request URI matches the *.php/* pattern as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜