Forum

Thread tagged as: Question, Problem, Runway

Search pagination breaking

Hey all,

I've taken over work on a Runway site and it seems the search pagination is broken, i have a feeling its a rewrite rule issue but i'm not 100% sure, the next page just links to ?page=2 instead of ?s=QUERY&page=2

my htaccess is as follows - i'm not 100% sure what's required and don't really want to break or change anything without a second opinion!!

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType text/css "access 1 week"
ExpiresByType text/html "access 1 week"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 week"
ExpiresByType application/x-shockwave-flash "access 1 week"
ExpiresByType image/x-icon "access 1 month"
ExpiresDefault "access 1 week"
</IfModule>

# 1 Month for most static assets
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>

## EXPIRES CACHING ##

# Perch Runway
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/perch
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /perch/core/runway/start.php [L]

RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{THE_REQUEST} \s(.+?)/+[?\s]
RewriteRule ^(.+?)/$ /$1 [R=301,L]

<IfModule mod_rewrite.c>
    RewriteEngine on
    # rules go here
</IfModule>

#RewriteRule ^news-and-views/([a-zA-Z0-9-/]+)$ /news-and-views/post.php?s=$1 [L]

Options +FollowSymLinks
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

the form and results template are based off the default Runway ones, the showall shows

paging  true
total   30
number_of_pages 3
total_pages 3
per_page    10
current_page    1
lower_bound 1
upper_bound 10
prev_url    
next_url    ?page=2
prev_page_number    
next_page_number    2
not_last_page   true
perch_item_last true
perch_item_zero_index   9
perch_item_index    10
perch_item_rev_index    1
perch_item_rev_zero_index   0
perch_item_odd  odd
perch_item_count    10
perch_namespace perch:search

Any help would be appreciated!

Thanks A

ewe agency

ewe agency 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please post your Diagnostics Report. We need this with all forum posts.

Perch Runway: 2.8.31
Production mode: Production (100)
Installed apps: content (2.8.31), assets (2.8.31), categories (2.8.31), perch_blog (5.0), perch_forms (1.8.3)
DB driver: PDO
DB tables: perch2_backup_plans (0), perch2_backup_resources (0), perch2_backup_runs (0), perch2_blog_authors (4), perch2_blog_comments (0), perch2_blog_index (337), perch2_blog_posts (6), perch2_blog_posts_to_tags (0), perch2_blog_sections (1), perch2_blog_tags (0), perch2_blogs (1), perch2_categories (6), perch2_category_counts (5), perch2_category_sets (2), perch2_collection_index (8986), perch2_collection_items (555), perch2_collection_revisions (100), perch2_collections (3), perch2_content_index (14643), perch2_content_items (1375), perch2_content_regions (300), perch2_forms (3), perch2_forms_responses (52), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_routes (22), perch2_page_templates (11), perch2_pages (54), perch2_resource_log (1630), perch2_resource_tags (563), perch2_resources (551), perch2_resources_to_tags (2250), perch2_settings (24), perch2_user_passwords (2), perch2_user_privileges (39), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (5)
Users: 5
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_forms',
        'perch_blog',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: ckeditor, markitup
H1: 29b696ab9a17638407c6e8dc99c20ced
L1: 2d867af9d415c6af77642c22d913763b
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.31: done
latest_version: 2.8.15
on_sale_version: 2.8.34
update_runway_2.8.31: done
perch_blog_update: 5.0.1
perch_blog_post_url: /news-and-views/{postSlug}
headerScheme: light
perch_blog_site_name:
perch_blog_slug_format: {postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_blog_comment_notify: 0
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_DATABASE: lebc
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: charlie.crossland@ewe.agency
PERCH_EMAIL_FROM_NAME: Charlie Crossland
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/chisan/Documents/Freelance/lebc/perch
PERCH_CORE: /Users/chisan/Documents/Freelance/lebc/perch/core
PERCH_RESFILEPATH: /Users/chisan/Documents/Freelance/lebc/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_MAP_JS: ../../webroot/js/perch_map.js
PERCH_GMAPS_API_KEY: AIzaSyDHzEdFhb0DNwIdjYM7YM1JLTcf9YVg4qA&callback=initMap
PERCH_RWD: 1
PERCH_DEBUG:
PERCH_SITEPATH: /
PERCH_RUNWAY: 1
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/chisan/Documents/Freelance/lebc/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 7.0.13
Zend: 3.0.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $
MySQL server: 5.6.34
Free disk space: 6.39 GB
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, gettext, mcrypt, pgsql, pdo_pgsql, igbinary, memcached
GD: Yes
ImageMagick: No
PHP max upload size: 32M
PHP max form post size: 32M
PHP memory limit: 128M
Total max uploadable file size: 32M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
HTTP_HOST: www.lebc.dev
HTTP_CONNECTION: keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER: https://www.lebc.dev/perch/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_COOKIE: cookieconsent_status=dismiss; cmsa=1; __utma=2857133.1405935889.1481780847.1487383159.1487700567.29; __utmb=2857133.171.10.1487700567; __utmc=2857133; __utmz=2857133.1481780847.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); PHPSESSID=d10fe421fc35a5d0eaaddef7aa964b40
PATH: /bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices
SERVER_SOFTWARE: Apache
SERVER_NAME: www.lebc.dev
SERVER_ADDR: ::1
SERVER_PORT: 80
REMOTE_ADDR: ::1
DOCUMENT_ROOT: /Users/chisan/Documents/Freelance/lebc
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Users/chisan/Documents/Freelance/lebc/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 64944
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1487704835.93
REQUEST_TIME: 1487704835
argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

If the link being generated in the HTML is incorrect, it's unlikely to be a rewrite issue at that point, is it not?

Is the output any different using the default template?

seems to be the same unfortunately

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. Can you show us what you've got?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can we see the Perch code you're using in your page and in the template?

Your install is a few versions behind, so it wouldn't hurt to update also. At least then we know what code any error messages refer to.