Redirecting http to a different, internal host

I am using Apache 2.4.10 on Slackware64 14.1, kernel 3.10.17. I've used Apache for years and am *fairly* fluent, but have never "redirected". Need some help.

I have 2 hosts behind a firewall: and The 0.2 server has an external IP public domain name, e.g. This server is running the Apache stated at top.

The host is actually a video DVR and shows the various camera videos live. This box has no Internet connection.

What I want is for people accessing to be routed to the DVR host. The following in httpd.conf works:

Redirect /DVR

but only inside the LAN. The reason being is that it only substitutes "" into the client browser. That IP is not resolvable from outside the LAN.

How do I accomplish what I want?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michael FowlerSolutions ConsultantCommented:
You want to look at setting up apache as a reverse proxy

Here is an example

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MarkAuthor Commented:
   <Location />
        Order allow,deny
        Allow from all

Open in new window

Sorry, your link is not an understandable example for me. He is forwarding all to I want to route requests for to Other requests for need to be handled by that server. I don't get where the 'DVR' directory name goes in Mr. Coyle's example, ServerName? Do you have a different example? Meanwhile, I'll also search around.
MarkAuthor Commented:
OK, I found a solution: All I need is the following in httpd.conf:
ProxyPass /DVR/

Open in new window

No need to configure VirtualHosts.

A final problem. Unless the user specifies a trailing '/' on DVR, I get a garbage screen. I've tried a 2nd ProxyPass line omitting the trailing slash:

ProxyPass /DVR

and a rewrite rule in $DOCUMENT_ROOT/.htaccess:

RewriteRule ^DVR$ DVR/ [R]

Neither work. Ideas?
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Michael FowlerSolutions ConsultantCommented:
Your rewrite rule looks fine. Have you made sure the rewrite module has been loaded and the engine turned on eg

LoadModule rewrite_module modules/

RewriteEngine On
RewriteRule ^/DVR$ DVR/ [R]
MarkAuthor Commented:
Your rewrite rule looks fine. Have you made sure the rewrite module has been loaded and the engine turned on ...
Yes, it is on. In fact I am using other rewrite rules. Perhaps one of two possible issues: 1) I did not specify a leading "/" and I also did not specify a RewriteBase, so I'll try it with the slash as you've shown. 2) perhaps the ProxyPass directive is processed before the rewrite rule in $DOCUMENT_ROOT/.htaccess? After the, the target web page is not really in $DOCUMENT_ROOT, so maybe in never looks there?

I can also try putting the rule in httpd.conf. I've never done that before, would it be the same anywhere in the "main" part of httpd.conf? :

RewriteEngine On
RewriteRule ^/DVR$ DVR/ [R]

Should I use the [R] flag or would [L] be more appropriate?

The [P] flag looks interesting
Use of the [P] flag causes the request to be handled by mod_proxy, and handled via a proxy request. For example, if you wanted all image requests to be handled by a back-end image server, you might do something like the following:

RewriteRule "/(.*)\.(jpg|gif|png)$" "$1.$2" [P]
MarkAuthor Commented:
Putting the following lines in httpd.conf did work:

RewriteEngine On
RewriteRule ^/DVR$ DVR/ [R]

Apparently those rules in .htaccess are not applied. Makes sense in a way because the target page is not in the $DOCUMENT_ROOT hierarchy.

Any thoughts on flags [R] versus [L] versus [P]?
Michael FowlerSolutions ConsultantCommented:
I have never really looked into this the flags but having a read it looks like the best option in this case would be the [P] flag as this rewrite is purely for the proxypass command.

Personally I would do a bit of testing but if I had to guess I think you would little or no difference between the flags in this implementation
MarkAuthor Commented:
Actually, the site recommended against using the [P] flag.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.