You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Igor Leturia <IG...@emun.com> on 2002/10/01 16:10:01 UTC

[users@httpd] Text substitution on output

  Hi all!

  I've got some pages in Apache and I need the server to make some
substitutions on the content of the pages when serving them (for
example, changing the text "user" for "Igor"). How can I achieve this?

  Thanks in advance,

						Igor Leturia

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Text substitution on output

Posted by daniel <da...@rawbyte.com>.
>   Hi all!
> 
>   I've got some pages in Apache and I need the server to make some
> substitutions on the content of the pages when serving them (for
> example, changing the text "user" for "Igor"). How can I achieve this?
> 

If you can modify the pages, then the way to go is some kind of dynamic page
generation mechanism, such as PHP or mod_include (as was already suggested)
These mechanisms allow you to replace all references to user with something
like:  <% echo $user %>  You can then define at the beggining of the page 
something similar to <% $user = "Igor" %>

Howver, if you cannot modify the page content, and you are running Apache 2,
you can use the filtering framework and write a program that does
the substitution. For example you can do this with mod_perl filtering
capabilities or with external filters:
http://httpd.apache.org/docs-2.0/mod/mod_ext_filter.html

Cheers

Daniel

-- 
Teach Yourself Apache 2 -- http://apacheworld.org/ty24/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Text substitution on output

Posted by Dave Stahr <da...@prairiesys.com>.
>   I've got some pages in Apache and I need the server to make 
> some substitutions on the content of the pages when serving 
> them (for example, changing the text "user" for "Igor"). How 

I don't know how fancy you want to get with it, but you could easily do
some simple CGI to achieve this.  Mail me off-list
dave@virtualimpressions.com if you would like to give this a shot and
I'll give you some simple examples in PERL.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org