Welcome to WebmasterWorld Guest from 54.167.0.111

Forum Moderators: ergophobe

Message Too Old, No Replies

Best method to share same content across domains on same server

     

crs123

6:59 pm on Sep 17, 2010 (gmt 0)



Hi,

I have 3 different domains on the same server that contain the same information in a couple of directories. I want to cut down having to update the same content 3 times over so I thought I could use an iframe but I don't like the results. I've tried using SSI but I get an error message that "given path not supported". Are there alternatives out there.

using dot.net thanks

ergophobe

8:03 pm on Sep 17, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



What is the underlying server technology?

On *nix, I would do this easily with symlinks - one directory or set of files in a central repository and pointers to them.

As of Vista (at least), Windows can do sym links too (or something very similar). I'm not sure about doing it on other Windows OSes

crs123

8:40 pm on Sep 17, 2010 (gmt 0)



Hi, thanks for your response. I'm using asp.net 1.1 on a Windows web server (2003). I've never used symbolic links before so this will be an interesting experience. Do you know of any tutorials out there on the web?

thanks again

ergophobe

9:45 pm on Sep 17, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I've never used them on Windows. On *nix it is extremely common to use them and they are very handy and the concept is quite simple. A simple example would be like this

DirA
- symlink-to-real-file
DirB
- symlink-to-real-file
DirC
-real-file

The files in A and B would appear as
path/to/DirA/symlink-to-real-file

But it's really more or less an alias that maps to the real file.

I use them, for example, to run multiple sites off the same code base (but different databases, so you can't tell by looking that they run on the same code).

As for windows, the concept should be the same, though I don't know if the implementation is as simple. I know only what a Google search tells me:
[msdn.microsoft.com...]

That's a start.

ergophobe

9:49 pm on Sep 17, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Actually, a little looking and symbolic links in Windows are probably not what you want (only available in Vista+ anyway)

You are more like interested in Hard Links or Junctions
[msdn.microsoft.com...]

This relatively simple concept in *nix though appears rather complicated in Windows.

crs123

9:51 pm on Sep 17, 2010 (gmt 0)



Your comments are very helpful! thank you so much for taking the time.

I'm going to give it a try!
I'll let you know if it worked for me.

LifeinAsia

9:59 pm on Sep 17, 2010 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Will all the content in the directories be shared (or just some files in them)? If all, you can create a Virtual Directory in IIS that may do what you need.

crs123

10:09 pm on Sep 17, 2010 (gmt 0)



Just some files but now I'm thinking of creating just a virtual directory for these shared files alone just to make it easier. This would probably be the best method to try now that you mentioned it! I don't know why I didn't think of it myself! thanks a lot! You've been a great help!

ergophobe

5:28 pm on Sep 18, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Thanks LIA - though a Windows user, I've never done anything with a Windows server and I'm always lost as to how to do things equivalent to mod_rewrite, symlinks and such as that.

LifeinAsia

3:35 pm on Sep 20, 2010 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



That's okay- I have no idea what a symlink is. :)

I'm guessing that it's a pointer to another directory, analogous to a virtual directory on a web server?

ergophobe

3:57 pm on Sep 20, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Mmmm.... more like an alias on a web server.

In the *nix world, directories are merely special types of files in general. A symlink is a pointer to another file, but that file can be a file or a directory.

So if I have
/home/ergophobe/site1codebase/script.php
/home/ergophobe/site2codebase - which is a symlink to site1codebase

Then the path
/home/ergophobe/site2codebase/script.php

is perfectly valid. I could also keep my code outside web root and have something like

/home/ergophob/public_html/site1 => symlink to /home/ergophobe/codebase/
/home/ergophob/public_html/site2 => symlink to /home/ergophobe/codebase/
/home/ergophob/codebase/script.php

Then both site 1 and site 2 have valid URLs
example1.com/script.php
example2.com/script.php

And in the script.php file itself I can simply detect the REMOTE_HOST or some other variable to then direct traffic.

crs123

6:26 pm on Sep 21, 2010 (gmt 0)



Just wanted to let you know that the virtual directory on windows 2003 server was very easy to do and worked like a charm....Thank you ergophobe for all your help!

ergophobe

7:08 pm on Sep 21, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Thanks... but that wasn't my idea.

I think you meant to thank Life in Asia. He's the one who knows about Virtual Directories but not symlinks. I'm the other one ;-)

LifeinAsia

8:30 pm on Sep 21, 2010 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Well, I certainly learned a lot about symlinks, so I'll add my thanks as well. :)

crs123

8:32 pm on Sep 21, 2010 (gmt 0)



OH, I'm sorry....thanks Life in Asia....You've helped me a great deal!

ergophobe

4:54 pm on Sep 22, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



And I learned that Virtual Directories exist. So I guess we're all richer for it and that's sort of the point of a discussion forum in the end, isn't it!

So I'll say thanks too.

LifeinAsia

5:20 pm on Sep 22, 2010 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



*sniff* I think I need a hanky... :)

ergophobe

6:05 pm on Sep 22, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Is the link broken for the MIDI track playing We Are the World? I'm not hearing it.