Welcome to WebmasterWorld Guest from 54.160.187.160

Forum Moderators: ergophobe

Message Too Old, No Replies

Best method to share same content across domains on same server

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

New User

5+ Year Member

joined:Sept 17, 2010
posts: 6
votes: 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
8:03 pm on Sept 17, 2010 (gmt 0)

Moderator This Forum

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

joined:Apr 25, 2002
posts:8326
votes: 154


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
8:40 pm on Sept 17, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 17, 2010
posts: 6
votes: 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
9:45 pm on Sept 17, 2010 (gmt 0)

Moderator This Forum

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

joined:Apr 25, 2002
posts:8326
votes: 154


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.
9:49 pm on Sept 17, 2010 (gmt 0)

Moderator This Forum

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

joined:Apr 25, 2002
posts:8326
votes: 154


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.
9:51 pm on Sept 17, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 17, 2010
posts: 6
votes: 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.
9:59 pm on Sept 17, 2010 (gmt 0)

Moderator from US 

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

joined:Dec 10, 2005
posts:5628
votes: 48


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.
10:09 pm on Sept 17, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 17, 2010
posts: 6
votes: 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!
5:28 pm on Sept 18, 2010 (gmt 0)

Moderator This Forum

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

joined:Apr 25, 2002
posts:8326
votes: 154


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.
3:35 pm on Sept 20, 2010 (gmt 0)

Moderator from US 

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

joined:Dec 10, 2005
posts:5628
votes: 48


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?
3:57 pm on Sept 20, 2010 (gmt 0)

Moderator This Forum

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

joined:Apr 25, 2002
posts:8326
votes: 154


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.
6:26 pm on Sept 21, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 17, 2010
posts: 6
votes: 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!
7:08 pm on Sept 21, 2010 (gmt 0)

Moderator This Forum

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

joined:Apr 25, 2002
posts:8326
votes: 154


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 ;-)
8:30 pm on Sept 21, 2010 (gmt 0)

Moderator from US 

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

joined:Dec 10, 2005
posts:5628
votes: 48


Well, I certainly learned a lot about symlinks, so I'll add my thanks as well. :)
8:32 pm on Sept 21, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 17, 2010
posts: 6
votes: 0


OH, I'm sorry....thanks Life in Asia....You've helped me a great deal!
4:54 pm on Sept 22, 2010 (gmt 0)

Moderator This Forum

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

joined:Apr 25, 2002
posts:8326
votes: 154


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.
5:20 pm on Sept 22, 2010 (gmt 0)

Moderator from US 

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

joined:Dec 10, 2005
posts:5628
votes: 48


*sniff* I think I need a hanky... :)
6:05 pm on Sept 22, 2010 (gmt 0)

Moderator This Forum

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

joined:Apr 25, 2002
posts:8326
votes: 154


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