Rolando
Rolando

Reputation: 62654

How to properly mask/redirect urls in apache httpd?

I have one apache httpd server running on a hostname:

firsthostname

I have another apache httpd server running on another hostname:

secondhostname

I want to make it such that whenever someone goes to:

firsthostname, it redirects to secondhostname. If the user goes to firsthostname/something, what the user actually sees is the as if the user went to "secondhostname/something", though the "secondhostname" is masked

What and how do I configure this on the httpd installed on "firsthostname"? I am running on a windows machine.

Upvotes: 0

Views: 3667

Answers (2)

Chris Ingis
Chris Ingis

Reputation: 696

You will need a DNS server. You can then simply setup a CNAME record to map firsthostname to secondhostname.

Upvotes: 0

Anshu
Anshu

Reputation: 7853

You can do this using apache rewrite or apache redirect

RewriteEngine  on
RewriteRule    ^/foo  /bar

Or

Redirect /foo.html /bar.html

Check out this documentation

Upvotes: 1

Related Questions