Welcome Guest, Not a member yet? Register   Sign In
Status of GET and querystrings in CodeIgniter?
#13

[eluser]n0xie[/eluser]
The only viable situation where a Query string might be preferable over a segmented url, is indeed a search query. As far as I know, every other read operation would be easier to do with segmented url's.

For example compare these two:
Code:
http://domain.tld/search/iwanttosearchforsomething
http://domain.tld/search/cat+dogs

vs

http://domain.tld/search?q=iwanttosearchforsomething
http://domain.tld/search?q=cats+dogs
As you can see, the first url is more human readable, has a better SEO value, and is the normal way of doing things in CodeIgniter. The only problem is that you might want to filter your search and then it gets ugly:

Code:
http://domain.tld/search/iwanttosearchforsomething/limit/10/page/2/
//or
http://domain.tld/search/iwanttosearchforsomething/10/2/

vs

http://domain.tld/search?query=iwanttosearchforsomething&limit=10&page=2

In this particular case the second version is easier. It's still worse for SEO, but the first version is ugly and requires you to either know the order in which to pass arguments/filters, or requires you to build logic that dissects the URL.

To solve this you can you could 'encrypt' the querystring so that it will become 1 argument, and then dissect it once you decrypt it. This is how the search function works.

Code:
http://domain.tld/search/0dfcd628ab258c55fdfc8ba83bbb018e

vs

http://domain.tld/search?query=iwanttosearchforsomething&limit=10&page=2

Either way, it's up to you to decide which of these you would prefer. My point is that I doesn't really matter which you prefer, since CodeIgniter let's you use EITHER or BOTH solutions.


Messages In This Thread
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 12:47 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 01:14 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 04:26 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 07:00 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 10:32 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 10:55 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 12:03 PM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 01:26 PM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 02:47 PM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-01-2010, 03:45 PM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-02-2010, 03:06 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-02-2010, 08:04 PM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-03-2010, 04:17 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-03-2010, 11:12 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-03-2010, 02:00 PM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-03-2010, 02:23 PM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-04-2010, 01:57 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-04-2010, 10:02 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-04-2010, 10:39 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-04-2010, 12:26 PM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-05-2010, 02:24 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-05-2010, 11:23 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 03-10-2010, 09:51 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 04-19-2010, 05:40 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 04-21-2010, 09:21 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 04-21-2010, 09:42 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 04-21-2010, 11:43 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 06-29-2010, 12:17 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 06-29-2010, 01:13 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 06-29-2010, 02:50 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 06-29-2010, 02:53 AM
Status of GET and querystrings in CodeIgniter? - by El Forum - 06-29-2010, 03:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB