I may be in over my head here. That said, I'd like to write a simple script (or tailor an existing one) that calls either one or another snippet of HTML, depending on which of two subdirectories the requested URL falls within.
For example, if the requested page is in my www.site.com/bluewidgets directory, then a picture of a blue widget would appear at the top. But if the requested page is in my www.site.com/redwidgets directory, then an image of a red widget would appear at the top instead.
My site is on an Apache server -- no PHP, but an early version of Perl was installed in my cgi-bin directory back in 1997.
Can a simple if-else script accomplish what I need? If so, can someone here link to a basic tutorial or a template. I can't seem to find anything on point. If not, I suppose I'll need to create two different server-side includes and add one or another tag to each and every HTML file. I could do that, of course, but it would be a hassle given the large number of files on my site. I'd prefer a simpler, more elegant solution.
I hope I've made all this clear enough.