ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Conditionals based on URL segments and case

May 17, 2011 1:44pm

Subscribe [1]
  • #1 / May 17, 2011 1:44pm

    municipal

    165 posts

    Say you have a simple conditional that says if segment_2 is “nosepicker” then load a particular template in the sidebar:

    {if segment_2 == "nosepicker"}{embed="page/finger"}{/if}

    Easy peasy, right? But what if the site visitor visits…

    <a href="http://www.example.com/main/NOSEPICKER/">http://www.example.com/main/NOSEPICKER/</a>

    Your conditional will fail, won’t it? What approach are other folks taking to avoid this happening? I’m seeing some solutions along the lines of strtolower (php string stuff), some Apache module stuff, etc. etc. Not quite sure I have a handle on server settings that address case sensitivity. Different sites I have on different hosts are responding differently to camelcase URLs when I was testing things.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases