Welcome to WebmasterWorld Guest from 54.160.177.33

Forum Moderators: open

Message Too Old, No Replies

Server Side Includes

Can they be only shown to certain users

     
7:02 pm on Jan 31, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Jan 21, 2003
posts:226
votes: 0


I have a number of SSI's that I wish to show to certain users and bots, is there away to have certain SSI's included dependent upon the request coming in.

Thanks

6:02 pm on Feb 1, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 22, 2001
posts:2450
votes: 0


Sure. If you have a list of the IP addresses of the visitors you want to show one thing to, use an SSI to call a CGI script which compares the IP address of the visitor against the list, then displays something based on the results of your test. You can do the same thing with the UserAgent string.
4:48 pm on Feb 23, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 16, 2003
posts:746
votes: 0


Some langauges like ASP do not allow conditional includes like this.

if($spider){
<!--#include virtual="/spider.html"-->
}else{
<!--#include virtual="/person.html"-->
}

Maybe you can do that sort of thing in PHP or ColdFusion.
You can probably get around this by doing it all within your code. Test for the condition, read the file and just echo it out.

Also remember you can use Iframes to show content to people but not spiders.