URL Segment Variables
ExpressionEngine provides an easy way for you to access information stored in the URL.
{segment_1}
{segment_2}
{segment_3}
{segment_4}
{segment_5}
{segment_6}
{segment_7}
{segment_8}
{segment_9}
These global variables represent data stored in the various segments of your page URL. By “segments”, we mean the segments of the URL that appear after your standard index.php file (or whatever you might have changed the name to be). A standard URL might look like:
http://www.example.com/index.php/products/shirts/
In the above URL, “products” is the Template Group, which happens to be in the “segment 1” position. “shirts” is the Template and is segment 2. If needed, you could access the values of either of those segments ("products" or “shirts") using {segment_1} or {segment_2}. The real power, however, will appear if you add additional information. For example:
http://www.example.com/index.php/products/shirts/large/blue/
With this, you can pass a shirt size ("large") as well as color ("blue") and access those values with {segment_3} and {segment_4}, respectively. You can use the data in any Template.
