Forum Moderators: phranque

Message Too Old, No Replies

two DNS, with same document root?

         

trevc

9:07 pm on May 26, 2009 (gmt 0)

10+ Year Member



I'm trying to work with our hosting vendor to temporarily run two DNS's on the same website (same document root) as we're moving to a new server, but keeping the old server for running scripts, etc. so want to do testing with the new DNS prior to going live.

I'm guessing people want to access a server with different DNS's (not repointing), i.e. www.company.com and www.company.ca.

I looked at the examples, but they really seem to handle IP based issues.

[httpd.apache.org...]

Would this be valid configuration to be able to access the 'same' webserver using two different DNS entries? (Also don't want this to happen... a user types in www.company.ca and it automatically is repointed to www.company.com ... it STAYS with .ca and vice versa if they come in with .com?

Any help or link to specific documentation is appreciated!

NameVirtualHost 216.251.43.98

<VirtualHost 216.251.43.98>
DocumentRoot /www/sitedocs
ServerName www.company.com
</VirtualHost>

<VirtualHost 216.251.43.98>
DocumentRoot /www/sitedocs
ServerName www.company.ca
</VirtualHost>

jdMorgan

12:53 am on May 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to use the same documentroot, then you could likely go even simpler... Just add
 [url=http://httpd.apache.org/docs/2.2/mod/core.html#serveralias]ServerAlias[/url] seconddomain.com www.seconddomain.com 

in the existing <VirtualHost> container.

Jim

trevc

1:56 am on May 27, 2009 (gmt 0)

10+ Year Member



thanks ... I really thought it should be that simple but the hosting service thought it might be simpler to replicate our site?

I've passed it by them... thanks for responding!

aluizn

6:40 pm on Aug 4, 2009 (gmt 0)

10+ Year Member



Please, I'd like to know if this sollution can be applied to my case.

I have a website and I'm trying to accociate my site with a bigger portal...
They want me to change my url from www.company.com to www.company.portal.com

but i dont wanna lose my url cause google finds me with it.
it would be the same site but been accessed by different urls.

so what do I have to do to achieve this?

jdMorgan

12:04 am on Aug 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> They want me to change my url from www.company.com to www.company.portal.com

That might sound like a good idea now, but essentially, you are giving them your content. They will seem to "own" your site.

Run away!

Jim

aluizn

12:17 pm on Aug 5, 2009 (gmt 0)

10+ Year Member



well...ok...thanks

but if we decide to do this, how could we?

jdMorgan

2:26 pm on Aug 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Change all the links on your site to point to their company.portal.com domain, then let them point their company.portal.com DNS to your Web server. Then go build yourself a new Web site, because your old site will now appear to belong to "portal.com".

Are you really ready and willing to give away your Web site? This is a really bad idea. Make sure your lawyer thoroughly examines and approves the contract before you do this, as you can otherwise easily lose your site.

Again... Run away!

Jim

aluizn

2:57 pm on Aug 5, 2009 (gmt 0)

10+ Year Member



I thought we could simply make a url masking.......or something like that...

we are waiting their IT team to get in touch with us about how could this could be done in a better way....

Thanks Jim

jdMorgan

4:51 pm on Aug 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're on Apache 2.x, you could implement an output filter to change your pages on-the-fly, but that's not a terribly efficient solution.

Jim

aluizn

4:59 pm on Aug 5, 2009 (gmt 0)

10+ Year Member



Why is it not efficient?

Can you show me how I can implement this output filter for me to make a test?

jdMorgan

12:51 am on Aug 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's inefficient because Apache has to 'look at every character in every file that it serves. It doesn't normally do anything but read the file from disk and sent it to the requesting client, so, like running SSI or PHP, or any other scripting, it adds overhead.

Take a look at the Apache documentation and try some searches -- Writing a filter isn't something I can just do in my limited spare time.

Jim