Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6132139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:03:51+00:00 2026-05-23T17:03:51+00:00

In CodeIgniter it’s really tricky to combine URI segments and Query strings at the

  • 0

In CodeIgniter it’s really tricky to combine URI segments and Query strings at the same time.
One of the traditional ways to almost achieve that is by enabling enable_query_strings.

The issue is that this has some weird behavior and it affects all the URL helpers as well.

By example when using: redirect('/home') it redirects to domain.com/?/home.

Based on my knowledge, enable_query_strings is not meant to be used with URI segments.

So how to extend the core to enable both GET and URI out of the box?

P.S. I know that it’s better to just use URI segments, but it’s very important sometimes to accept GET queries like from adwords.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:03:52+00:00Added an answer on May 23, 2026 at 5:03 pm

    The best solution is this:

    • Make sure you are on the latest version of CI, currently 2.0.2
    • Forget about the misleading enable_query_strings (it’s not what you want)
    • Open your config file and set allow_get_array to TRUE, which will allow you to use $_GET
    • Play with the uri_protocol setting until you find one that works for your environment, PATH_INFO works for me.
    • Enjoy the use of proper query strings!

    enable_query_strings breaks almost all the functionality that makes Codeigniter great, including all the helper functions that deal with urls. It was some experimental feature that has been confused with normal query string support for as long as CI has been around.

    Bottom line – just upgrade (if you haven’t already) and don’t try to write a hack for it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In codeigniter framework How I execute a select query with where clause and put
using CodeIgniter normally one has to specify the controllers in the config/routes.php file. This
I am using PHP/codeigniter, and typically to loop over query results I would do
I currently use CodeIgniter as my framework of choice when using PHP. One of
I am using codeigniter's session class to handle my PHP sessions. One of the
Seems codeigniter only allows one instance of a library I can't design a solution
Using Codeigniter, any numeric data returned from my MySQL database is returned as strings.
Our CodeIgniter-based website has a section showing the last time a user logged in
In Codeigniter I want to know the best practice for using the same views
CodeIgniter allows access to POSTed data via: $this->input->post('input_name'); where 'input_name' is the name of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.