0

Default library Pagination of Codeiniter use segment with url like this : products/list/1

But , i want config paging use query string.

I have try enable $config['page_query_string'] = TRUE but result is products/list&page=1

Then , it is not format of query string, i want link paging is : products/list?page=1

Please help me ;(

2 Answers 2

0

You need to follow these steps:

  1. In application/config/config.php set:

    $config['enable_query_strings'] = true;

  2. Again in application/config/config.php set:

    $config['uri_protocol'] = "PATH_INFO";

  3. Change your .htaccess to remove the ? (if present) in the rewrite rule:

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

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

6 Comments

If you want to add ? mark then RewriteRule ^(.*)$ index.php/?$1 [L]
if i set $config['uri_protocol'] = 'PATH_INFO'; page list will be load home page :(
If you dont then what will happen ?
If i set $config['uri_protocol'] = PATH_INFO or QUERY_STRING , all other page will load same home page.
Can you send me your account skype to help me solve this problem :( ?
|
0

Please define base url like

$config['base_url'] = 'your path';
$config['page_query_string'] = TRUE;

So your query string is append with above base url like 'path?query_string_of_pagination'

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.