Remove .php extensions with .htaccess

Posted by:

You can clean up your URL a little by automatically removing the .php extensions and index files using mod_rewrite. This requires your web server has Apache running the mod_rewrite module. Create an .htaccess file in your web root directory with this content:

# Author: Lil Josh (
# Date: Sept 2014
# Description: Clean up the URL by removing the .php extension and index file
RewriteEngine On
RewriteBase /
# Unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ $1 [R=301,L]
# Redirect external .php requests ...
Continue Reading →

Velocity Cheat Sheet

Posted by:

Setting a Variable

#set($varName = "example value")

Using a Variable



##Comments have two pound signs in front

XPath Tool (Single Node)

#set($firstName = $_XPathTool.selectSingleNode($contentRoot, "firstName").value)
##$contentRoot is a special variable to select the root of the structured data for the page/block
##.value gets the value of that node

XPath Tool (Multiple Nodes)

#set($people = $_XPathTool.selectNodes($contentRoot, "people"))
<p>There are $people.size() people</p>

For Each Loop

#foreach($person in $people)
#set($firstName = $_XPathTool.selectSingleNode($person, "firstName").value)
##notice we used $person instead of $contentRoot this time

**NEW – ...

Continue Reading →

Cascade Server’s Index Blocks vs Locator Tool vs Query API

Posted by:

I’ve compared performance using Cascade Server’s Index Blocks, Velocity Locator Tool and the new (as of version 7.12.2) Query API.

The method:

I setup 3 configurations in a configuration set to get a little over 800 assets.

  1. use an index block that includes metadata and XML inline (i.e. structured data)
  2. use velocity’s locator tool to loop through folders and get children down 3 levels.
  3. use velocity’s Query API to get pages of a specific content type (no limit)

The implementation:

Index block ...

Continue Reading →
Page 2 of 11 12345...»