cakephp 路由不允许文件扩展名
我需要一个 cakephp 路由,如果与之前不包含文件扩展名的路由不匹配,它将捕获所有 url。
当前捕获所有内容的路线如下
Router::connect('/*', array('controller' => 'frontend', 'action' => 'display',null));
我需要将上述路线修改为不捕获所有带有文件扩展名的网址
I need a cakephp route which will catch all urls if not matched in previous routes that do not contain file extensions.
Current route for catch all below
Router::connect('/*', array('controller' => 'frontend', 'action' => 'display',null));
I need the above route modified to not all urls with file extensions to be caught
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在基于 CakePHP 1.2 的应用程序中为动态生成的图像添加扩展名的内容如下:
上面的代码使以下两个 url 都可以访问:
http://myhost.com/posts/postImage/125
和
http://myhost.com/posts/postImage/125.png
我认为CakePHP 1.3 也是如此,我希望它对您有所帮助。
What I have donr in my app based on CakePHP 1.2 to add extension to dynamic generated images is as follows:
The above code makes both the folloing url are accesible:
http://myhost.com/posts/postImage/125
and
http://myhost.com/posts/postImage/125.png
I think that the same will going with CakePHP 1.3 and I hope that It helps you.
我不太明白你的需求,但你可以这样做:
和链接:
我希望这会对你有所帮助。祝你好运
I don't understand very well your demand, but you can do this:
And the link:
I hope this will help you. good luck