我的域名允许以特殊字符 (www.testing.com/home/login-) 结尾。我如何确保这是不允许的并且显示页面不存在,因为正确的 URL 是 www.testing.com/home/login$routeCustom = new \Zend_Controller_Router_Route( '/:controller/:action', array( 'module' => 'website', "controller" => "default", "action" => "default" ), array( 'controller'=>'^[a-zA-Z-_0-9]+', //accept: a to z , A to Z , - , _ , 0-9 'action'=>'^[a-zA-Z-_0-9]+' ));
1 回答
HUWWW
TA贡献1874条经验 获得超12个赞
这是如何:
$routeCustom = new \Zend_Controller_Router_Route(
'/:controller/:action',
array(
'module' => 'website',
"controller" => "default",
"action" => "default"
),
array(
'controller'=>'^[a-zA-Z-_0-9](.*[a-zA-Z0-9])$', //accept: a to z , A to Z , - , _ , 0-9
'action'=>'^[a-zA-Z-_0-9](.*[a-zA-Z0-9])$'
)
);
- 1 回答
- 0 关注
- 132 浏览
添加回答
举报
0/150
提交
取消