Codeigniter Routes for filename with extension

Posted by thehuby on Stack Overflow See other posts from Stack Overflow or by thehuby
Published on 2009-12-14T23:20:30Z Indexed on 2010/04/05 15:23 UTC
Read the original article Hit count: 339

Filed under:
|
|

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 :)

© Stack Overflow or respective owner

Related posts about codeigniter

Related posts about routes