prepending vars (useful tip when working with subdomains or multilanguage sites) |
[eluser]smoku[/eluser]
Hello! I moded CI a little bit because I needed to prepend var. With this mod you can create links like: http://www.domain.com/index.php?user=USE...er/method/.... I needed this in order to create user sites with subdomains: USERNAME.domain.com/controller/method => domain.com/index.php?user=USERNAME&/controller/method/ But it could be also very useful with multilanguage sites. You can easily redirect: domain.com/LANG/controller/method => domain.com/index.php?lang=LANG&/controller/method query_strings must be TURNED ON! ---------------------------- Here is the code: Open Router.php In function _set_route_mapping() at the begining change: Code: // Fetch the complete URI string to: Code: // Fetch the complete URI string Add this function to router.php: Code: function _remove_query_strings($string) I don't know if anyone finds this helpful but I needed this in my project so I'm posting this, because I couldn't find it... |
Messages In This Thread |
prepending vars (useful tip when working with subdomains or multilanguage sites) - by El Forum - 01-24-2008, 06:36 PM
prepending vars (useful tip when working with subdomains or multilanguage sites) - by El Forum - 01-24-2008, 08:09 PM
prepending vars (useful tip when working with subdomains or multilanguage sites) - by El Forum - 01-25-2008, 03:55 AM
prepending vars (useful tip when working with subdomains or multilanguage sites) - by El Forum - 01-25-2008, 03:59 AM
prepending vars (useful tip when working with subdomains or multilanguage sites) - by El Forum - 01-25-2008, 04:21 AM
prepending vars (useful tip when working with subdomains or multilanguage sites) - by El Forum - 01-25-2008, 04:29 AM
|