473,408 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

domain name pointing to a page

My clients would like to have their own domain name but pointing at a
webpage.

if somebody clicks www.clientsite.com

the site should point to

www.mysite.com?client=455

It is possible ? how ?

Bob
Jul 17 '05 #1
7 1720
*** Bob Bedford wrote/escribió (Tue, 24 May 2005 09:28:31 +0200):
My clients would like to have their own domain name but pointing at a
webpage.

if somebody clicks www.clientsite.com

the site should point to

www.mysite.com?client=455

It is possible ? how ?


<?

header('Location: http://www.mysite.com?client=455');
exit;

?>

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #2

"Alvaro G Vicario" <al******************@telecomputeronline.com> a écrit
dans le message de news: 1j******************************@40tude.net...
*** Bob Bedford wrote/escribió (Tue, 24 May 2005 09:28:31 +0200):
My clients would like to have their own domain name but pointing at a
webpage.

if somebody clicks www.clientsite.com

the site should point to

www.mysite.com?client=455

It is possible ? how ?


<?

header('Location: http://www.mysite.com?client=455');
exit;

?>

My question was mainly how to get that the client typed www.clientsite.com
and then redirect. I know how to redirect, I don't know how to get the typed
URL.
Jul 17 '05 #3

It sounds to me like you imagine that a request can be plucked out of
the ether before it reaches a host and redirected to somewhere of your
choosing. Your clients must first buy the domain "clientsite.com" and
then set up the redirect as suggested using any of the usual methods,
including the specific one provided by Alvaro.

When someone types the URL "http://www.clientsite.com" into their
browser address bar, the browser contacts their ISP and asks for the IP
address of the host "www.clientsite.com". The ISP knows the IP address
because the domain name has been bought and registered and so exists in
the Domain Naming System. Back comes the reply 216.37.46.27 and the
browser then sends a request to that host. The host receives the
request and sends back the response. If the response is a redirect
you'll get the effect you want.

I assume you specified "client=455" because that is meaningful to the
script executing at www.mysite.com. You therefore know that the request
came originally from www.clientsite.com because you will set things up
so www.clientsite.com is the only host that redirects to
www.mysite.com?client=455. Some other client www.randomsite.com will
forward to (for instance) www.mysite.com?client=123

The PHP to determine the value of "client" is also very basic:

...
$lngClient = $_GET[ "client" ];
...

---
Steve

Jul 17 '05 #4
*** Bob Bedford wrote/escribió (Tue, 24 May 2005 14:45:38 +0200):
I don't know how to get the typed URL.


Short answer: you cannot.

Long answer: you can kind of figure out. Check the $_SERVER associative
array with print_r() or var_dump(). There're keys like HTTP_HOST or
REQUEST_URI that maybe help you.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #5

"Steve" <go********@nastysoft.com> a écrit dans le message de news:
11**********************@o13g2000cwo.googlegroups. com...

It sounds to me like you imagine that a request can be plucked out of
the ether before it reaches a host and redirected to somewhere of your
choosing. Your clients must first buy the domain "clientsite.com" and
then set up the redirect as suggested using any of the usual methods,
including the specific one provided by Alvaro.

When someone types the URL "http://www.clientsite.com" into their
browser address bar, the browser contacts their ISP and asks for the IP
address of the host "www.clientsite.com". The ISP knows the IP address
because the domain name has been bought and registered and so exists in
the Domain Naming System. Back comes the reply 216.37.46.27 and the
browser then sends a request to that host. The host receives the
request and sends back the response. If the response is a redirect
you'll get the effect you want.

I assume you specified "client=455" because that is meaningful to the
script executing at www.mysite.com. You therefore know that the request
came originally from www.clientsite.com because you will set things up
so www.clientsite.com is the only host that redirects to
www.mysite.com?client=455. Some other client www.randomsite.com will
forward to (for instance) www.mysite.com?client=123

Sounds like I didn't expain well the whole thing:

www.mysite.com and www.clientsite.com both point to my website
(www.mysite.com)
Now, when any person type one or the other URL, then the result is my
website.
What I want to achieve, is that when he types www.clientsite.com, then I
redirect to the client=455.

So in my index.php, I'd like to know wich URL was typed (mysite.com or
clientsite.com) and redirect if the URL is clientsite.com.
Sounds simple, and many website do it. I'd like to know how.

Bob
Jul 17 '05 #6
Bob Bedford wrote:

"Steve" <go********@nastysoft.com> a écrit dans le message de news:
11**********************@o13g2000cwo.googlegroups. com...

It sounds to me like you imagine that a request can be plucked out of
the ether before it reaches a host and redirected to somewhere of your
choosing. Your clients must first buy the domain "clientsite.com" and
then set up the redirect as suggested using any of the usual methods,
including the specific one provided by Alvaro.

When someone types the URL "http://www.clientsite.com" into their
browser address bar, the browser contacts their ISP and asks for the IP
address of the host "www.clientsite.com". The ISP knows the IP address
because the domain name has been bought and registered and so exists in
the Domain Naming System. Back comes the reply 216.37.46.27 and the
browser then sends a request to that host. The host receives the
request and sends back the response. If the response is a redirect
you'll get the effect you want.

I assume you specified "client=455" because that is meaningful to the
script executing at www.mysite.com. You therefore know that the request
came originally from www.clientsite.com because you will set things up
so www.clientsite.com is the only host that redirects to
www.mysite.com?client=455. Some other client www.randomsite.com will
forward to (for instance) www.mysite.com?client=123

Sounds like I didn't expain well the whole thing:

www.mysite.com and www.clientsite.com both point to my website
(www.mysite.com)
Now, when any person type one or the other URL, then the result is my
website.
What I want to achieve, is that when he types www.clientsite.com, then I
redirect to the client=455.

So in my index.php, I'd like to know wich URL was typed (mysite.com or
clientsite.com) and redirect if the URL is clientsite.com.
Sounds simple, and many website do it. I'd like to know how.

Bob


Bob,

You can't do it that way. You need to set it up in the server.

The reason is this: When they type in http://www.clientsite.com, the DNS
may direct it to your web server. However, your server will look at the
incoming request, and see it isn't for www.yoursite.com - and since it
doesn't know about www.clientsite.com, it rejects the request.

For Apache, look up the Virtual Host command. If you're using IIS,
there is a similar way to do this - I just haven't looked into it to
find out how.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 17 '05 #7

Ah, sorry, that makes more sense 8-)

If you haven't got virtual hosts set up:

For Apache:
http://httpd.apache.org/docs/vhosts/

For IIS:

http://www.microsoft.com/technet/pro...out/steps.mspx

Once you have virtual hosts set up, PHP's predefined environment
variable $_SERVER[ 'HTTP_HOST' ] is your friend.

Steve

Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Charles | last post by:
Hi, I have a site that has several domains pointing to its DNS. I would like to implement a script that will grab the domain name visitors typed in, and display it on the page. Is there a way to...
27
by: Tim Tyler | last post by:
Are there many PHP public domain projects out there? I'm particularly interested in CMS project materials. So far - outside of my own projects - I've found /very/ little PD PHP material out...
5
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post...
5
by: Dany C. | last post by:
We have install a valid SSL certificate issued to www.mycompany.com on our web server running IIS 6.0 / win2003 SP1. Then we have created a sub domain pointing to the same server for our web...
2
by: johkar | last post by:
I am getting an Access denied error when I write to a new window. The situation and code are outlined below. I am setting the domain in the main window. The problem is that the window I am...
2
by: Christopher Brandsdal | last post by:
Hi! I have found a script to lookup domain names, but it is written in C#. I want so bad to translate this to VB! Can anyone help me? I have tried myself. The script seems to run fine, but I...
6
by: Guy Macon | last post by:
While I agree with the sentiment, the oringinal title on this thread ("OT: Specially for , why you should always use example.com for obfuscating domains") is wrong. There are other reserved domain...
1
by: Andy B | last post by:
I have 2 web applications: Main and InHim. I currently have 2 domain names pointing to these applications. www.eternityrecords.org/ points to Main and www.inhim.eternityrecords.org points to InHim....
3
by: bnashenas1984 | last post by:
Hi everyone I'v made a website which allows users to have their own subdomains Each user can have a blog in a unique subdomain Now I need to let my users register their own domain names and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.