Welcome Guest, Not a member yet? Register   Sign In
Replace underscore (_) with dashes (-) in URL
#1

[eluser]livewirerules[/eluser]
i have been going through the website and googling for a working solution to replace all the _ with - for the urls. Below is a solution which i found, but doesn't work.

Code:
<?php
class MY_Router extends CI_Router
{
    function _set_request($segments = array()) {
        parent::_set_request(str_replace('-', '_', $segments));
    }
}
?>

i added to the core folder but nothing happens to the url. Can someone suggest be a good solution where i can replace the underscores. i don't want to use the routing feature because i have over 300 urls.

Any help will be appreciated.


Messages In This Thread
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-30-2013, 08:26 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-30-2013, 10:26 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-30-2013, 11:54 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-30-2013, 04:41 PM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 06:04 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 06:07 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 06:17 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 06:45 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 07:31 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 08:53 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 08:56 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 10:31 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 10:36 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 10:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB