The following code should show either the port or server name not both.
I always get both no matter what ?
<!--#if expr="${SERVER_PORT} = 80" -->
<!--#echo var="SERVER_PORT"-->
<!--#else -->
<!--#echo var="SERVER_NAME"-->
<!--#endif -->
I have also tried the following with no joy either:
<!--#if expr="${SERVER_PORT} = '80'" -->
<!--#if expr="${SERVER_PORT} = /80/" -->
How do I get this working?
If you're using IIS 6 check that Server Side Includes are permitted:
If they are, then check that the SSI Script Maps are enabled in the web site properties:
.shtm,
shtml and .stm
are mapped to
C:\WINDOWS\system32\inetsrv\ssinc.dll
and that the verbs are set to GET
and POST
.Updated:
IIS doesn't support the #if/#else/#endif
construct or #set
. IIS 6.0's Server Side Include directives are documented here:
These are for all intents and purposes the same as those used in IIS 5.1.
The directives you're trying to use are supported on Apache, though your should check with your hoster/admin to make sure they're enabled. For more info see: