CodeIgniter Forums
[solved] allow query string (?p=) to one directory only - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: [solved] allow query string (?p=) to one directory only (/thread-67943.html)



[solved] allow query string (?p=) to one directory only - dbrooke - 04-28-2017

Hello CI'ers,
I'm trying to embed a forum app into a codeigniter page. The problem I am running into is that the app is producing tradition query string calls which CI is not allowing.. ie. I get a 404.

When I (globally) allow traditional query strings in config.php:

$config['enable_query_strings'] = TRUE;

The site doesn't work.

I then tried overriding the config in just the forum controller itself:

$this->config->set_item('enable_query_strings', TRUE);

That did not work.

Any ideas?


RE: allow query string (?p=) to one directory only - dbrooke - 04-28-2017

FYI, this is an example of a call that is generated by the app that returns a 404:
http://domain.com/daforum/index.php?p=/&remote=http%3A%2F%domain.com%2Fforum%2F&locale=

The same call without the query string:
http://domain.com/daforum/index.php

Works fine.


RE: allow query string (?p=) to one directory only - dbrooke - 04-28-2017

Strange thing.. if I change one character of that first URL, it works fine.. it's the '&' char. before 'remote':

domain.com/daforum/index.php?p=/?remote=http%3A%2F%2Fdomain.com%2Fforum%2F&locale=

I then tried allowing '&' characters via the config.php as such:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\&\=\-';

This did not work.


RE: allow query string (?p=) to one directory only - dbrooke - 05-02-2017

I solved this in config.php by doing:
$config['enable_query_strings'] = FALSE;

and
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\&\=\-';

Then editing the .htaccess file for the app that was sending the query string call... seems to work.

Donovan