Get URL and parameters with SSI

mesnicka picture mesnicka · Sep 17, 2010 · Viewed 12.2k times · Source

I have to get URL and parameters with SSI (only with SSI), but I can't find any solution.

For example: http://www.test.com/abc.html?data=something

And I have to get value of parameter "data".

Answer

ahgood picture ahgood · Mar 5, 2011
<!-- set default value for SSI variable "data" -->    
<!--#set var="data" value="" -->

<!-- get "data" value from URL --> 
<!--#if expr="$QUERY_STRING = /data=([a-zA-Z0-9]+)/" -->
<!--#set var="data" value="$1" -->
<!--#endif -->

<!-- print the "data" value -->     
<!--#echo var="data" -->