Forum

Thread tagged as: Problem, Blog

Posts not showing with clean urls

Im trying to create clean urls on a live server

.htaccess is in site root:

<IfModule mod_rewrite.c>  
    RewriteEngine on  
   RewriteRule ^blog/([a-zA-Z0-9-/]+)$ /blog/post.php?s=$1 [L]
</IfModule>

and blog post page path is set to /blog/{postSlug}

blog home page works fine but blog post page is blank. The url is clean and looks exactly right, but the page is blank. Its only ok if I put 'post.php?s=' back into the post page path.

And while I'm at it, how can I change the name of the blog so that it doesn't say 'blog' in the url, but shows a different name instead?

Chris James

Chris James 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You can change the blog folder to anything you like, those are just examples.

If you are getting a "blank page" then you have a PHP error so you would need to look in the error log to see what the actual error is.

https://solutions.grabaperch.com/development/why-am-i-getting-a-blank-page

I'm a bit stuck here. All php errors/warnings in the error log only relate to some errors from a few days ago - nothing relating to today. There is no html being output onto the post page. Just a 404 error message.

File permissions are all set correctly (0644). If I pput back the 'post.php?s=' it works fine, but without the clean url.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

You said earlier you were getting a blank page, if you are getting a 404 then that is a straightforward page not found. Your rewrite rule is incorrect in some way for the actual location of your page.

You haven't posted your Diagnostics Report so I don't know whether that rule would match the location or not.

OK I discovered my .htaccess had an rtf extension!

Now I cant work out how to change the name of the blog - Ive changed the name of the blog folder and replaced 'Blog' in htaccess with the new name, and the Blog post page path too, but I'm getting 404 again

Perch: 2.8.24
Production mode: Production (100)
Installed apps: content (2.8.24), assets (2.8.24), categories (2.8.24), perch_blog (5.0)
DB driver: PDO
DB tables: perch2_blog_authors (6), perch2_blog_comments (0), perch2_blog_index (1299), perch2_blog_posts (5), perch2_blog_posts_to_tags (0), perch2_blog_sections (1), perch2_blog_tags (0), perch2_blogs (1), perch2_categories (4), perch2_category_counts (3), perch2_category_sets (1), perch2_content_index (0), perch2_content_items (0), perch2_content_regions (0), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (0), perch2_pages (0), perch2_resource_log (136), perch2_resource_tags (0), perch2_resources (98), perch2_resources_to_tags (0), perch2_settings (23), perch2_user_passwords (1), perch2_user_privileges (35), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (5)
Users: 5
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: markitup, ckeditor
H1: e9ddf3731de511da8af3e7dbf0ac050d
L1: 4c081249016046fe67a277d2af9ff50d
F1: dc1fef2ad0fcd9f943c02ebb43d85dbc
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.21: done
latest_version: 2.8.15
on_sale_version: 2.8.24
perch_blog_update: 5.0.1
perch_blog_slug_format: {postTitle}
update_2.8.24: done
headerScheme: light
perch_blog_site_name:
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_blog_post_url: /blockchain-bugle/{postSlug}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: bblf_05creative
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: bblf_dev
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: chris@05creative.com
PERCH_EMAIL_FROM_NAME: Chris James
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/bblf/public_html/dev05/perch
PERCH_CORE: /home/bblf/public_html/dev05/perch/core
PERCH_RESFILEPATH: /home/bblf/public_html/dev05/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_RUNWAY:
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_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/bblf/public_html/dev05/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 5.6.17
Zend: 2.6.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $
MySQL server: 5.5.47-cll
Free disk space: 39.64 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, calendar, ctype, curl, dom, fileinfo, filter, ftp, gd, hash, iconv, SPL, json, mbstring, mcrypt, session, mysql, mysqli, standard, Phar, posix, Reflection, mysqlnd, SimpleXML, sockets, imap, tokenizer, xml, xmlreader, xmlwriter, zip, cgi-fcgi, XCache, suhosin, PDO, pdo_sqlite, pdo_mysql, XCache Cacher, ionCube Loader
GD: Yes
ImageMagick: No
PHP max upload size: 32M
PHP max form post size: 32M
PHP memory limit: 256M
Total max uploadable file size: 32M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
CONTEXT_DOCUMENT_ROOT: /home/bblf/public_html/dev05
DOCUMENT_ROOT: /home/bblf/public_html/dev05
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: cmsa=1; _gat=1; _ga=GA1.2.8619265.1453981040; PHPSESSID=80b3cad60edafb700dc8d0d1f82ecd03
HTTP_HOST: dev05.bblf.info
HTTP_REFERER: https://dev05.bblf.info/perch/core/settings/diagnostics/
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36
PATH: /bin:/usr/bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 81.97.237.32
REMOTE_PORT: 61523
REQUEST_METHOD: GET
REQUEST_SCHEME: http
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/bblf/public_html/dev05/perch/core/settings/diagnostics/index.php
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
SERVER_ADDR: 89.145.100.106
SERVER_ADMIN: webmaster@dev05.bblf.info
SERVER_NAME: dev05.bblf.info
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache/2.4.18 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4
UNIQUE_ID: Vq4ECVmRZGoAAHl6xdsAAAAD
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1454244873.92
REQUEST_TIME: 1454244873
argc: 1
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Is the page at the location you expect, disregarding any rewrite rules.

Can you now go to: /blockchain-bugle/ and see your blog listing page?

And /blockchain-bugle/post.php?s=a-valid-slug and see a detail page?

Is so then you have an error in your htaccess file, if not then your blog is not at the location specified in settings.

fixed. Thank you very much