URGENT!!! HELP ME!!! |
[eluser]Lima[/eluser]
I must using CI with config like this : Code: $config['enable_query_strings'] = TRUE; Some client hit my url like this http://ipserver:8080/index.php?name=some...omeaddress It should be http://ipserver:8080/index.php?c=search&...omeaddress How do I automatically set URL with c=search parameter. .htaccess file or config/route.php Is there somebody can help me?
[eluser]pistolPete[/eluser]
I don't use query strings, but can't you just set a default controller? Code: $route['default_controller'] = 'search';
[eluser]Lima[/eluser]
Thanks pistolPete but it does work, it show Page Not Found other solution please?
[eluser]pistolPete[/eluser]
Put this on the top of your index.php: Code: <?php
[eluser]xwero[/eluser]
The problem is that there is no routing for query_strings build in CI. In the router there is this Code: // Are query strings enabled in the config file? Code: function index()
[eluser]Lima[/eluser]
Thanks for all I think I must modify library/Router.php for general case like this : Code: function _set_routing() Is there anything wrong with my modification, it just my opinion, hope it will implement for next version.
[eluser]xwero[/eluser]
[quote author="pistolPete" date="1235672589"]Put this on the top of your index.php: Code: <?php Using the index.php file as a router could turn out very ugly. if you want to do it at least use a separate file and include it.My solution loads a file that doesn't need to be loaded so that is not the best way either. The best way would be to alter the router to load a get routes file like its done for the segment based routes.
[eluser]xwero[/eluser]
Lima i think it's best not to mix query string and segment routes because they are not interchangeable. This would be the route for what you want to achieve: Code: $routes['([name|address])(.+)'] = 'c=search&$1$2'; So your change is too little to have effect. |
Welcome Guest, Not a member yet? Register Sign In |