Log in

View Full Version : One Website with TWO names?



Markxxx
04-07-2008, 04:59 AM
I was just wondering is something like this would be possible

I have two domain names I currently am not using. Eventually I will do something with them.

I'll call them XYZ.com and ABC.com


If I have a website with facts that have nothing to do with either name I know I can redirect the urls very easily to the index.html

I was wondering if it would be possible to just to have some kind of script on the page so if the user went to http://xyz.com you'd get the page but the logo, the title bar and the <h1> title would say "Welcome to XYZ.com".

BUT If the user typed in http://abc.com the exact same page would appear but with the logo, title bar and header "Welcome to ABC.Com"

Since neither url has anything to do with the webpage contents rather than make and copy the pages twice, would it be possible through some coding, I'm guessing Javascript to do this.

I don't know really WHY I'd want to do this, I was just wondering in.

I know it can be done but I wasn't looking for anything overly complex.

Thanks

tixrus
04-07-2008, 05:07 AM
I do that, I essentially do it in PHP I check the name of the server that was invoked, and depending on what that is, I serve a different header.