----- Original Message ----- From: "Mario R. Sanchez, Ph.D." <[EMAIL PROTECTED]>
To: "Petr Vileta" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Tuesday, April 04, 2006 5:57 PM
Subject: Re: CSS via CGI dynamically called


hi peter
running linux radhat 9.2 and apache. tried moving the css to various
locations - all readable by apache to no avial.

Try this

THE SCRIPT
#!/usr/bin/perl
use CGI;
open (THENEWS, "news.htm");
print "Content-type: text/html\n\n";
while ($record = <THENEWS>) {
# here is the trick
  $record=~s(\w+\.css)#../$1#i;
  print $record;
}
close(THENEWS);
exit;

But be sure that the URL to your script is eg. http://www.domain.com/cgi-bin/thescript.cgi
and URL to your css style is http://www.domain.com/program.css
In this case the relative URL between script and style is "../" (one directory up). The same trick you can use to rewrite some <script ... src="some.js"....> links included in your html code.

Petr Vileta, Czech republic
(My server reject all messages from Yahoo and Hotmail. Send me your mail from another non-spammer site please.)


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to