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.

Segment appears empty in URL but isn't according to EE

December 02, 2008 7:22pm

Subscribe [1]
  • #1 / Dec 02, 2008 7:22pm

    Wayde Christie

    24 posts

    Hi folks,

    I have a weirdness where I’m checking for the existence of a segment, and getting strange results. The url segment itself is empty, however when I output {segment_2} it displays an ampersand.

    I’ve tried {if segment_2 == '&'} but no cigar.

    I’m thinking this is definitely a .htaccess issue, since we get rid of index.php using Leevis .htaccess generator plugin.

    Any ideas?

    Cheers,

    Wayde.

  • #2 / Dec 02, 2008 7:39pm

    Wayde Christie

    24 posts

    OK - have sussed problem.

    It seems that this line in the .htaccess was the offender:

    RewriteRule ^(.*)$ /index.php/$1&%{QUERY_STRING} [L]

    That little ampersand in there was showing up in segment_2. Since we have no query strings at all, I removed &%{QUERY_STRING} and problem solved.

  • #3 / Dec 02, 2008 8:41pm

    Greg Aker

    6022 posts

    Wayde:  I’m glad you got it working.  Don’t hesitate to post again should anything else come up!

    -greg

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

ExpressionEngine News!

#eecms, #events, #releases