One site, two URL's
I'm just in the thinking-about stage but here's my idea. I want to make a new website for my own personal use (mostly family stuff). The site URL and corresponding email addresses would be appropriate for my name, but not for my wife. So my host allows me to have two domains so I'm thinking of getting a second domain for her. This would be mainly so her email address would be more appropriate for her, but I may as well have her URL go to our site too.
The easiest answer would be a simple URL forwarding. That's okay but you'll see the change in the address bar. So another option would be "framing" or "masking" the site. But are there other options that I'm not thinking about? What about some cool way to share most of the content but to customize some of the headers, footers, and graphics to customize each a little bit.
This is just a personal site so I'm not gonna sweat this one, but just let me know if there are any tips, tricks, or suggestions for having one site with two url's (the customized content is just extra).
The Webmistress posted this at 18:46 — 20th September 2002.
She has: 5,586 posts
Joined: Feb 2001
Ask your host whether the two domains can both point to the same folder on the server and that way you can have the two domains sharing the same site but will still have their own addresses shoing in the browser.
Julia - if life was meant to be easy Michael Angelo would have painted the floor....
zollet posted this at 19:30 — 20th September 2002.
He has: 1,016 posts
Joined: May 2002
Hi Mike,
You can have multiple domains show the same website without forwarding or framing, etc. For example, we have many customers that have .com and .net of a domain and want all to load the same site. You can also have the email work for both domains. As Julia suggested, you need to talk with your web host about this and see if they can do it for you, but it is possible.
fifeclub posted this at 19:59 — 20th September 2002.
He has: 688 posts
Joined: Feb 2001
Cool. Thanks.
fifeclub posted this at 20:04 — 20th September 2002.
He has: 688 posts
Joined: Feb 2001
Actually, now that I know it's possible (depending on what my host says), is there some sort of script that can say "if url says abc.com then load this graphic or include file"?
zollet posted this at 21:04 — 20th September 2002.
He has: 1,016 posts
Joined: May 2002
Yes, you easily could do that with PHP...
<?php
if(eregi(\"domain\.com\", $_SERVER[\"HTTP_HOST\"])) {
//if domain.com, then execute code here
} else {
//if other than domain.com (i.e. domain.net) execute code here
}
?>
Hmm.. the board doesn't show the backslash "\" before the "." in eregi(). Anyways, the "domain.com" should be "domain\.com"
fifeclub posted this at 01:16 — 21st September 2002.
He has: 688 posts
Joined: Feb 2001
Awesome! Thanks. I won't get started on coding for several weeks, but let me make sure I get this right (I'm not a real webmaster so I need to make sure I understand ).
1) There's a "\" before the domain in the first part but but not in the other two places, right? (with me replacing it with my 'primary' domain name)
2) I don't need to write "//if domain.com, then execute code here", I just put some php code (ie. an include file call) in those two orange areas, right?
3) Just checking, but is that a typo in "REQUEST_URI" (should it be REQUEST_URL)?
Thanks again. I'm looking forward to trying this out!
zollet posted this at 04:32 — 21st September 2002.
He has: 1,016 posts
Joined: May 2002
1. Only replace the first "domain.com" with your own domain name and put a "\" (backslash) before the "." (dot).. i.e. "domain\.com"
2. You can removed those two lines as they are only comments.
3. Actually, I was wrong, use $_SERVER["HTTP_HOST"] instead.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.