Forum Moderators: phranque

Message Too Old, No Replies

Redirect/mirror/alias

need to know capabilities to redirect all content in a directory, w/diffURL

         

turkeybot

8:16 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



Hello,

My company has a website URL: www.example.com/ that forwards to: www.parentcompany.com/jsp/ca/

that latter address is also in the address bar and yes it's ugly as all hell. What I want it to do is to mirror/alias that latter url and all content following the ca/ so that entering www.example.com/somedir/content.jsp will yield the file found in: www.parentcompany.com/jsp/ca/somedir/content.jsp, but will NOT change the URL.

I had thought that this could be done with a global rewrite rule (maybe?), but my IT people are telling me that it has to be scripted on all pages (and there are many)... I'm pretty sure they are either not understanding my request or do not know that this is possible.

So, I ask you, the all knowing, about how a server admin would go about making this happen as that parentcompany URL is ugly and cannot be used in print.

thanks!

Jesse

jdMorgan

2:08 am on Jun 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1) If both domains are hosted on the same server, then use mod_alias or mod_rewrite to serve content from the parentcompany.com directories when example.com pages are requested.

2) If they are on different servers, then you could use mod_proxy, but be aware that example.com would then be seen as the requestor of all pages that it proxies; A request to example.com will cause the example.com server to send a request to parentcompany.com, get the response, and pass that back to the original client. So, all that traffic actually passes through example.com, and from parentcompany.com's viewpoint, example.com will be the requesting IP address in all cases. This can cause problems with geoIP-type locator scripts and visitor tracking in general if the scripts used to provide this information are not sophisticated enough to examine the proxy headers that identify the original client through the proxied connection.

3) Another alternative is to simply point the example.com domain to the parentcompany.com server's IP address, and then you're back to case 1 above.

This is not an "easy" subject; I'll refer you to apache.org for mod_alias, mod_rewrite, and mod_proxy documentation.

Jim

turkeybot

5:19 pm on Jun 14, 2005 (gmt 0)

10+ Year Member



Thanks for the pointers. I did some more research and I found that there is a VirtualHost directive that can be used with Apache, and seems to be exactly what I'm asking for (make the root dir of example.com, parentcompany.com/jsp/ca/). I told that to the server guys and that seemed to stick, hopfully it'll all work out.

Since example.com just forwards to parentcompany.com, I don't think there is any content on the server, but yeah, once the VirtualHost is complete, they will be defacto on the same server, all under parentcompany.com.

This site helped me out: [httpd.apache.org...]

thanks!

[edited by: jdMorgan at 2:24 am (utc) on June 15, 2005]
[edit reason] Changed citation to authoritative URL. [/edit]