Forum Moderators: phranque

Message Too Old, No Replies

Rewrite domain to appear as another domain

         

burnside

5:16 pm on Aug 6, 2010 (gmt 0)

10+ Year Member



Hi,

I have a content management system running on a server, cms.myhost.com. I would like my visitors to access the pages on that server as if it came from www.myhost.com/news. Thus, when they navigate through the site on www.myhost.com/news, the content is actually coming from cms.myhost.com.

Any pointers? I've used mod-rewrite but not to this extent!

Thanks!
b

burnside

5:32 pm on Aug 6, 2010 (gmt 0)

10+ Year Member



Just to make it clear, these are two separate servers on different machines running, not a single server.

g1smd

5:40 pm on Aug 6, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You'll need to configure the main machine as a proxy for when /news/ URLs are requested, but this will slow down external accesses to that content and make a mess of your logs unless you take a lot of care in setting things up. There's many prior WebmasterWorld threads with detailed information.

gavinLive

5:41 pm on Aug 6, 2010 (gmt 0)

10+ Year Member



You would need to add the following alias into your apache httpd.conf file at the end.

Alias /news/ "c:/www/cms/"

<Directory "c:/www/cms/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>


Basically, this doesn't really involve cms.myhost.com much but I think this method is a lot better and will be slightly quicker. What this does is adds a new alias so that when you type www.myhost.com/news/, its actually directory is at c:/www/cms

This isn't exactly what you asked for, but I think its better.

jdMorgan

5:43 pm on Aug 6, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Just to make it clear, these are two separate servers on different machines running, not a single server.

So unfortunately, "Alias" won't work here. A reverse-proxy is needed to meet the posted requirements.

Jim

burnside

6:00 pm on Aug 6, 2010 (gmt 0)

10+ Year Member



Yeah, the two separate machines is where I got stuck. A reverse-proxy? Ok, I'll look that up.