SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
May 28, 2002, 15:39 #1
- Join Date
- Aug 2000
- Posts
- 37
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Simple Script for homepage (hopefully)
Hi everyone!
Sitepoint has never let me down in the past, so I thought I would give it another go for the new script I need
Here is an idea of what i want to do, maybe someone could tell me the best way to achieve this?
My main site:
mysite.com
Other domain names I own:
domain1.com domain2.com someother.com somethingelse.com
In apache, I have all of the above domains set to point to "mysite.com" using the "server alias" directive. All of the domains are for sale and I would like to give the user a little info instead of just directing them to mysite.com when they type domain1.com into their browser.
Here is what I had in mind.
1) User Visits Domain1.com
2) User is directed to mysite.com
3) User is displayed a link at the top of the page on mysite.com saying "Why was I brought here when trying to access domain1.com"
4) User clicks link, and it takes them to a page explaining that domain1.com is for sale
I was hoping to pass the domain name to this page in a variable so that I dont need a different page for each domain name I am selling.
Any ideas on the best way to achieve this?
Thanks in advance
-
May 28, 2002, 15:44 #2
- Join Date
- Apr 2002
- Location
- Tucson, AZ
- Posts
- 176
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here you go. Found it in 30 sec by using search...you should try it
-
May 28, 2002, 15:49 #3
- Join Date
- Aug 2000
- Posts
- 37
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That thread didn't help me at all. Thanks for trying though.
-
May 28, 2002, 16:13 #4
- Join Date
- Apr 2002
- Location
- Tucson, AZ
- Posts
- 176
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Re: Simple Script for homepage (hopefully)
What do u mean it didn't help...you said
Originally posted by TechTalk
I was hoping to pass the domain name to this page in a variable so that I dont need a different page for each domain name I am selling.
Maybe this is not what you were meaning to ask for...can you give us more info on what else you need.
-
May 28, 2002, 16:21 #5
- Join Date
- Feb 2002
- Location
- Birmingham, UK
- Posts
- 496
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
try this on "mysite.com"..
PHP Code:<?
if(preg_match("/domain1.com/",$HTTP_REFERER)){
echo "Why was I brought here when trying to access domain1.com";
}
elseif(preg_match("/domain2.com/",$HTTP_REFERER)){
echo "Why was I brought here when trying to access domain2.com";
}
elseif(preg_match("/domain3.com/",$HTTP_REFERER)){
echo "Why was I brought here when trying to access domain3.com";
}
?>Last edited by redgoals; May 28, 2002 at 16:49.
http://redgoals.com ... my site ... nuff said
-
Jun 10, 2002, 14:34 #6
- Join Date
- Aug 2000
- Posts
- 37
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Basically all of these other domains are setup in the virtual config for mysite.com in apache. There I am using "ServerAlias" to direct all the other domains to the domain mysite.com
If possible, I would like to put all the domain names in some sort of array if possible, and run a check thru the array when the user is brought to the page.
I dont even really need to post any text on mysite.com like i originally stated. If it could just redirect the user to a page on mysite.com explaining that the domain they accessed is for sale that would be great.
I have little to no knowledge of php, but I thru a basic concept together of what I am trying to do. Any advice would be much appreciated.
Code:<? $domains=array( "domain1.com", "somedomain.com", "domain111.com", "anotherdomain.com", "yetanother.com", "anorg.org", "anothercom.com", "gogogo.com", "yoyooy.com", "johndoe.net", "joe.com", ); if (preg_match($domains, $HTTP_REFERER) { header("Location:http://www.mysite.com/domains/index.php?domain=$HTTP_REFERER"); } ?>
Code:<html> <head> <title></title> </head> <body> The domain, <? echo $domain ?> is for sale! </body> </html>
-
Jun 10, 2002, 14:39 #7
- Join Date
- Aug 2000
- Posts
- 37
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I just checked, and $HTTP_REFERER has no value if the user is directed the way that I am directing them (using apache's ServerAlias directive)
-
Jun 10, 2002, 15:09 #8
- Join Date
- Dec 2001
- Location
- Sioux City, Iowa
- Posts
- 691
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
try using $REQUEST_URI instead of $HTTP_REFERER. with register_globals off i think its $_SERVER['REQUEST_URI'].
Last edited by Trav; Jun 10, 2002 at 15:12.
Bookmarks