You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by jericho escobar <sh...@mail.com> on 2005/09/09 09:27:00 UTC

[users@httpd] Apache module to modify content

Dear Apache Gurus,

This is my first post and I'm hoping that this is the write place to ask this question. I've read the FAQ on http://www.catb.org/~esr/faqs/smart-questions.html and googled a bit before resorting to the mailing list. 

Here is the question.

I have the following html file.
<html><body><img src="/testme/find.jpg"></body></html>

I would like to write an Apache module that will parse this file and send the following to the browser:

<html><body><img src="http://imageserver/testme/find.jpg"></body></html>

I basically want to modify the server response before sending it back to the client.

Is this doable by creating an apache module or can someone please recommend a better way to do this? I've tried rewriting the request using RewriteRules but I would prefer to rewrite the URL on the fly before serving it out.

I've gone through the mod_include source code (for SSIs) and I'm thinking that this is one way I can do the work but wanted to check with the list to see if anybody had better ideas

Thank you in advance.

~j

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm


---------------------------------------------------------------------
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] Apache module to modify content

Posted by Eimantas Vaičiūnas <ei...@unit.lt>.
I think apache module developers has their own mailing-list.

jericho escobar wrote:
> Dear Apache Gurus,
> 
> This is my first post and I'm hoping that this is the write place to ask this question. I've read the FAQ on http://www.catb.org/~esr/faqs/smart-questions.html and googled a bit before resorting to the mailing list. 
> 
> Here is the question.
> 
> I have the following html file.
> <html><body><img src="/testme/find.jpg"></body></html>
> 
> I would like to write an Apache module that will parse this file and send the following to the browser:
> 
> <html><body><img src="http://imageserver/testme/find.jpg"></body></html>
> 
> I basically want to modify the server response before sending it back to the client.
> 
> Is this doable by creating an apache module or can someone please recommend a better way to do this? I've tried rewriting the request using RewriteRules but I would prefer to rewrite the URL on the fly before serving it out.
> 
> I've gone through the mod_include source code (for SSIs) and I'm thinking that this is one way I can do the work but wanted to check with the list to see if anybody had better ideas
> 
> Thank you in advance.
> 
> ~j


---------------------------------------------------------------------
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] Apache module to modify content

Posted by Nick Kew <ni...@webthing.com>.
On Friday 09 September 2005 08:37, Davide Bianchi wrote:
> jericho escobar wrote:
> > I have the following html file.
> > <html><body><img src="/testme/find.jpg"></body></html>
> > I would like to write an Apache module that will parse this file and send
> > the following to the browser: <html><body><img
> > src="http://imageserver/testme/find.jpg"></body></html>
>
> I thought that mod_html_proxy was already doing something like this.

Yep (apart from the typo).  mod_proxy_html will do exactly that.  And if
the above was just an example and the OP in fact wants a wider range
of rewriting, there are several available modules, up to and including
mod_publisher, offering vastly more extensive manipulation of markup.

-- 
Nick Kew

---------------------------------------------------------------------
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] Apache module to modify content

Posted by Davide Bianchi <da...@onlyforfun.net>.
jericho escobar wrote:
> I have the following html file.
> <html><body><img src="/testme/find.jpg"></body></html>
> I would like to write an Apache module that will parse this file and send the following to the browser:
> <html><body><img src="http://imageserver/testme/find.jpg"></body></html>

I thought that mod_html_proxy was already doing something like this.

Davide


---------------------------------------------------------------------
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