I need to rewrite a incoming request for a particular file. The file will have a suffix of .rtfx and I need to remove the host (http://www.host.com/) and replace it with another.

Request *.rtfx file Request is http://www.host.com/blah/blah/rtfx.com Replace http://www.host.com/ with something else.

I have tried to figure out how to do this with mod_proxy, but it looks like mod_rewrite is my only option.


With mod_proxy:

ProxyPassMatch ^/(blah/blah/.*\.rtfx)   http://www.somewhereelse.com/$1

With mod_rewrite:

RewriteEngine On
RewriteRule  ^/(blah/blah/.*\.rtfx)     http://www.somewhereelse.com/$1 [P,L]

Put this in the server config for your host...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.