in reply to Re^2: Changing http headers in cgi response
in thread Changing http headers in cgi response

I would, but Your Mother already gave a good example in Re^3: Changing http headers in cgi response. There's no better advice I could give than to start there and to take specific questions about Apache and mod_rewrite to a forum where those are on topic (or the Chatterbox here if they are short and simple questions, since that's not really topic-limited).
  • Comment on Re^3: Changing http headers in cgi response