Codeigniter Routes for filename with extension

老子叫甜甜 提交于 2019-12-24 18:38:52

问题


I am using codeigniter and its routes system successfully with some lovely regexp, however I have come unstuck on what should be an easy peasy thing in the system.

I want to include a bunch of search engine related files (for Google webmaster etc.) plus the robots.txt file, all in a controller.

So, I have create the controller and updated the routes file and don't seem to be able to get it working with these files.

Here's a snip from my routes file:

$route['robots\.txt|LiveSearchSiteAuth\.xml'] = 'search_controller/files';

Within the function I use the URI helper to figure out which content to show.

Now I can't get this to match, which points to my regexp being wrong. I'm sure this is a really obvious one but its late and my caffeine tank is empty :)

来源:https://stackoverflow.com/questions/1904230/codeigniter-routes-for-filename-with-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!