![]() |
Bluehost and GET parameters - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Bluehost and GET parameters (/showthread.php?tid=16916) |
Bluehost and GET parameters - El Forum - 03-20-2009 [eluser]jiffier[/eluser] Hi all, I have an application deployed on Bluehost but I'm facing the problem of accessing request parameters: While testing on my local box, I was using PATH_INFO. But PATH_INFO on bluehost doesn't seem to work (always gets the default controller). Here is my .htaccess file: Code: AcceptPathInfo On If I use uri_protocol=AUTO then it gets the controllers correctly, but a URL containing parameters throws an error: Code: The URI you submitted has disallowed characters. If I set it to ORIG_PATH_INFO, then any request makes an infinite redirect. If I set it to REQUEST_URI or QUERY_STRING, I get the same as AUTO. I'm running out of ideas, has anyone suceeded in reading request parameters under C.I at Bluehost? Any help appreciated, thanks! -- Dani Bluehost and GET parameters - El Forum - 03-20-2009 [eluser]TheFuzzy0ne[/eluser] What's the URI you're using? Also, please post your config.php file, minus any sensitive information. Bluehost and GET parameters - El Forum - 03-20-2009 [eluser]jiffier[/eluser] The problematic URL is Code: /customers/13?folder=2 The error it throws is <b>"The URI you submitted has disallowed characters."</b> Here is the config.php: Code: $config['base_url'] = "http://www.domain.com/"; Thanks in advance, -- Dani Bluehost and GET parameters - El Forum - 03-20-2009 [eluser]TheFuzzy0ne[/eluser] The way you are using your URL would is as if you're trying to access a file named "13" in a directory named "customers" directly. It looks like your htaccess file is already trying to reroute that via index.php. What your query string URI should look like, is something like this: Code: /?c=customers&m=13&folder=2 Bluehost and GET parameters - El Forum - 03-20-2009 [eluser]jiffier[/eluser] Yes.. I have the .htaccess file that routes to CodeIgniter's index.php, but why then this URL does work correctly? Code: /customers/13 The CustomerController has a _remap method that will end up displaying data for customer id 13. The strange thing is that this works on a local testing environment (Debian + apache). Would this work if I could get PATH_INFO uri_protocol mode to work? TIA, -- Dani Bluehost and GET parameters - El Forum - 03-20-2009 [eluser]TheFuzzy0ne[/eluser] I can only assume that you've added a '?' to your allowed_uri_characters on your development environment. Just out of interest, why exactly do you want to use query strings? I create a library which allows you to send arguments in a similar fashion over the URI, without having to use query strings. You might want to check it out: http://ellislab.com/forums/viewthread/106502/. Bluehost and GET parameters - El Forum - 03-20-2009 [eluser]jiffier[/eluser] No, I haven't added that on my Dev env... here it is: Code: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_-'; If I add the "?" to permitted_uri_chars doesn't work either, but I think that the most reasonable will be stop using query strings, and one of the reasons is that I don't know yet where this application will end up being hosted. I saw the uri_to_assoc() in http://ellislab.com/codeigniter/user-guide/libraries/uri.html, which looks very promising.. I don't know if it's available in 1.6.3 (the version I'm using), otherwise I could upgrade. I should upgrade anyway, the validators in 1.7 look promising too ![]() -- Dani Bluehost and GET parameters - El Forum - 03-20-2009 [eluser]TheFuzzy0ne[/eluser] I agree. If you haven't got too far into developing your application, it would be an ideal time to upgrade. I like to make sure I'm running the latest version at the start of each new project. |