0

Please note I am using codeigniter 3.0.3.

In my current project I want to use both query string and segment base url. When I enable

$config['enable_query_strings'] = TRUE

segment base stopped working. I have used all options of uri protocol e.g.

$config['uri_protocol'] = 'PATH_INFO'; //REQUEST_URI,QUERY_STRING

Is there any way to use both with out any errors. I want to use url helpers in segmented url's and at few places I want to use query strings too.

1 Answer 1

1

Checking URI.php core class, it can be seen that query appendix is meant to work when config uri protocol is set to

$config['uri_protocol'] = 'REQUEST_URI';

You don't need to set

config['enable_query_strings'] = TRUE;

option to true if you want to be able to grab key=value from URI. It is needed only if you want query strings without segments in URI.

You can optionally enable standard query string based URLs:

example.com?who=me&what=something&where=here

So your options should be

$config['uri_protocol'] = 'REQUEST_URI';
config['enable_query_strings'] = FALSE;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.