Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

HTTP_USER_AGENT, SSI and Meta Tags

Quote Reply
HTTP_USER_AGENT, SSI and Meta Tags
Hi,

Originally on normal html pages I have been using SSI to cloak meta tags:

<!--# if expr="\"$HTTP_USER_AGENT\"!= /Mozilla|MSIE|Opera|Lynx|WebTV|NCSA Mosaic/" -->

TAGS HERE

<!--# endif -->


This allows the search engines to see your tags but not the general internet user. I know it is not perfect but I guess it must be 80% effective.

However, as cgi generated pages can't use SSI (or so I understand) can this be rewritten for use under Links SQL? I don't have the ability to write the template tag sytax or global - can someone help - I am sure others might find it useful.

Cheers

Alex



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery
Quote Reply
Re: [IndigoClothing] HTTP_USER_AGENT, SSI and Meta Tags In reply to
Should be able to. Try creating a new global, called 'check_browser'


Code:
sub {

if ($ENV{'HTTP_USER_AGENT'} =~ /Mozilla|MSIE|Opera|Lynx|WebTV|NCSA Mosaic/i) { return "true"; }

}

Then run the check with;

Code:
<%if check_browser%>
meta tags here
<%endif%>

Hope that works.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] HTTP_USER_AGENT, SSI and Meta Tags In reply to
ANdy,

Thanks for the help but the tags still appear!? Crazy I have installed you global correctly. Any clues?

Once again, many thanks for the help.

Alex



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery
Quote Reply
Re: [IndigoClothing] HTTP_USER_AGENT, SSI and Meta Tags In reply to
I have changed the tags to:

Code:
if check_browser%>
<%else%>
meta tags here
<%endif%>

This now seems to work as the tags no longer appear when I select "view source".Smile

Alex



Indigo Clothing is a t-shirt printing company based in the UK.
Indigo Clothing | Promotional Clothing | T-Shirt Printing | Embroidery

Last edited by:

IndigoClothing: Aug 6, 2003, 1:54 PM
Quote Reply
Re: [Andy] HTTP_USER_AGENT, SSI and Meta Tags In reply to
Eugh, my boo boo. The code I provided would show the meta tags only to someone in a matching browser, and not vice-versa. This should work;

<%ifnot check_browser%>meta tags here <%endif%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!