我正在尝试路由所有网段,但也有例外。所以我想路由:除(home|about|contact)之外的任何内容。差不多吧。
我已经设法在codeigniter中做到了这一点,但是在Zend Framework中我遇到了更多的困难。在codeigniter中,我会在configs/routes.php文件中写下这一行:
$route['^(?!home|about|contact)\S*'] = "category";
这是我的zend项目的routes.xml中的内容。
<category>
<type>Zend_Controller_Router_Route_Regex</type>
<route>(?!home|about|contact)</route>
<defaults>
<controller>category</controller>
<action>index</action>
</defaults>
<reverse>%s</reverse>
</category>发布于 2011-12-24 19:42:55
根据zfded的评论添加答案,
<route>(^(?!home|about|contact)\S*)</route>应该是正确的路线。
https://stackoverflow.com/questions/6695858
复制相似问题