CodeIgniter Forums
How to use - instead of _ in CI 3.0? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: How to use - instead of _ in CI 3.0? (/thread-616.html)



How to use - instead of _ in CI 3.0? - zaltanklis - 12-26-2014

As I know character _ is prohibit in CI, I really want to use "-" in link. Have anyone know how to use "-" in CI 3.0 ? I mean display link.

I am using nginx so have any guide to rewrite _ to - ?

Thank you


RE: How to use - instead of _ in CI 3.0? - Avenirer - 12-29-2014

In CI 3.0 you can go to routes.php and set 'translate_uri_dashes' to TRUE. This way, the application will automatically translate uri's with "-" to controllers with "_". See more here: http://avenir.ro/codeigniter-tutorials/removing-the-index-php-from-the-url-and-allow-the-use-of-search-engine-friendly-urls/