0

First of all I MUST point out that I am NOT a programmer, have NO desire to be a programmer, and the application i am speaking of was NOT written by me. I am just an average end user trying to make things work like I need them to work. That being said,

Two simple questions:

1.) Why will urls like this not work with codeigniter powered apps ?

http://somesite.com/search?q=something

2.) How do I force it to work like that ?

I have read atleast 2 dozen articles on the issue and NOTHING has worked. I have enabled QueryStrings in the config file, I have change the url_protocol to PATH_INFO, I have set my forms from post to get and NOTHING works.

HELP...

6
  • Why do you need a particular app to work with a certain kind of URL format? It all depends on the application really, but in most cases, you should be able to adapt. Commented Jul 18, 2011 at 9:28
  • I NEED it to work like this because I have another application that needs this behavior. I could simply write some very ugly code (since I am not a programmer an all) for the other application to make an exception for ALL codeigniter apps or I could just fix the problem that CI dev team seems to ignore and be done with it. Commented Jul 18, 2011 at 9:39
  • possible duplicate of How to use both URI segments and Query strings without enabling: enable_query_strings Commented Jul 18, 2011 at 9:56
  • The main issue is that you need to enable allow_get_array which is not introduced until version 2.0.2 (currently the latest version). enable_query_strings, although it sounds like it should do what it says, it completely different. Commented Jul 18, 2011 at 9:57
  • It's not a duplicate because I am NOT the developer in this case. I do not have codeigniter on my system. I am just an end user of an application I found on the net which was written with codeigniter. Commented Jul 18, 2011 at 10:01

1 Answer 1

0

Ok, try changing $config['uri_protocol'] = "PATH INFO"; to $config['uri_protocol'] = "REQUEST_URI";

If this still does not work, check your .htaccess file for a rule that removes index.php from URL; it will be of the form:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/?$1 [L]

If this rule exists, change the last line to `RewriteRule ^(.*)$ index.php/$1 [L]

Notice, the ? is removed from last line. Check after doing above steps. Hope this works.

Sign up to request clarification or add additional context in comments.

3 Comments

I changed the protocol as suggested and tried again and got a 404 error when trying to load the page so I created an .htaccess file and copied and pasted the rules you posted into it and placed it in my scripts main folder and still got a 404 error. Next ...
CAn you post your routes.php file
@Mark, in your htaccess file, replace RewriteRule ^(.*)$ index.php/?$1 [L] with RewriteRule ^(.*)$ index.php/$1 [L] Notice, the absence of "?" in the above rule. this will surely work

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.