Search, readable URLs, disallowed characters and err 400. Help! |
[eluser]BilliamTheSecond[/eluser]
I'm trying to set up a fulltext search and still have a readable URL (instead of base64 encoding). My search form submits to a controller function that looks kind of like this: Code: function validate() { http://dragffy.com/blog/posts/codeignite...characters Note: Can't type things like % 23 in this forum without it being replaced with the # character. Using {percent} instead. Now, when I search for "test phrase", I'm redirected to search/"test{percent}20phrase" and Quote:"test phrase"is echoed out. That's working. Three problems I'm having so far with this approach: 1) Searching for phrases with # characters, like test#phrase redirect me to search/test{percent}23phrase properly, but only Quote:testis echoed out. 2) Searching for phrases with % characters, like test%phrase redirect me to search/test{percent}25phrase and I now get a Bad request! Error 400 In fact, throwing {percent}25 into my URL anywhere causes this error. 3) Searching for phrases with / characters, like test/phrase redirect me to search/test/phrase and I get a 404. [edit]Added #3 Any and all help appreciated.
[eluser]BilliamTheSecond[/eluser]
I _think_ I've solved these three issues by adding the B flag to my index.php rewrite Code: RewriteRule ^(.*)$ index.php [B] Code: AllowEncodedSlashes On Not sure what this will break down the line, though. :/
[eluser]victorche[/eluser]
A little bit late for an answer, but ... Try like this: Code: $query = rawurlencode(rawurlencode($this->input->post('query')));
[eluser]Vangelis B[/eluser]
For future readers: Depending on your apache version this one may be unsolvable and may require refactoring parts of your application. This is due to an apache bug. Read more about it here: http://stackoverflow.com/questions/43904...-on-apache |
Welcome Guest, Not a member yet? Register Sign In |