| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| skylark -
 
 
 Joined: 08 Feb 2003
 Posts: 10
 Location: Missouri
 
 | 
			
				|  Posted: Tue Feb 11, 2003 1:56 am    Post subject: Easy script needed... Can you help? |   |  
				| 
 |  
				| I am looking for a script that to me seems like it would be very easy to make. I dont know if it would be cgi, php or even maybe even just plain ole java. I know what it might look like, and I know what I want it to do but I dont know how to write script. I know the first thing is that I need to learn to write script, but I also know there is someone out there that already has the script or can easily write it for me(which I would greately appreciate). 
 I want the script to work so that when someone accesses my index.html file it will read the url in the window address bar and then redirect them to a folder from there.
 What I think it might look like is:
 if window.url="http://www.gothere.com" goto="http://0.0.0.0/gothere/index.html
 and if window.url="http://www.getit.com" goto="http://0.0.0.0/getit/index.html
 etc etc
 
 The reason for this is that I have 5 domain names, all pointing to my ip htdocs folder, I for now have simply put up a link from there to the sites that Im hosting, however this seems tacky when you want to go to getit.com and you end up on a page with 5 other names and you're being asked to click the link you want to visit. But technically the folders are mearely one folder under the index. being http://0.0.0.0/folder1/index.html.
 
 I think this is a very easy script but I may be wrong. It's happened like once before...haha
 
 Any help or even a response would be greatly appreciated.
 :)
 |  | 
	
		| Back to top |         | 
	
		|  | 
	
		| Bluedog -
 
 
 Joined: 05 Jan 2003
 Posts: 179
 
 
 | 
			
				|  Posted: Tue Feb 11, 2003 6:46 pm    Post subject: |   |  
				| 
 |  
				| OK, I just wrote this in php, it should do what you want. 
 
  	  | Code: |  	  | <?php
 if ($HTTP_HOST == "domain1.com") {
 ?>
 <META HTTP-EQUIV=Refresh CONTENT="0; URL=domain1/home.html">
 <?
 }
 if ($HTTP_HOST == "yoursite2.net") {
 ?>
 <META HTTP-EQUIV=Refresh CONTENT="0; URL=yoursite/index.php">
 <?
 }
 if ($HTTP_HOST == "yoursite3.net") {
 ?>
 <META HTTP-EQUIV=Refresh CONTENT="0; URL=yoursite3/index.php">
 <?
 }
 
 if ($HTTP_HOST == "yoursite4.net") {
 ?>
 <META HTTP-EQUIV=Refresh CONTENT="0; URL=yoursite4/index.php">
 <?
 }
 
 if ($HTTP_HOST == "yoursite5.net") {
 ?>
 <META HTTP-EQUIV=Refresh CONTENT="0; URL=yoursite5/index.php">
 <?
 }
 
 
 else {
 ?>
 <META HTTP-EQUIV=Refresh CONTENT="0; URL=linklist.html">
 <?
 }
 
 ?>
 <title>Taking you to your page.</title>
 
 | 
 
 Basically, it checks the url, if it is 1 it goes to one, 2 to 2, etc. If it is neither, it shows a list of available sites, in linklist.html.
 
 Neil
 |  | 
	
		| Back to top |       | 
	
		|  | 
	
		| skylark -
 
 
 Joined: 08 Feb 2003
 Posts: 10
 Location: Missouri
 
 | 
			
				|  Posted: Tue Feb 11, 2003 7:39 pm    Post subject: Thanks |   |  
				| 
 |  
				| Thank you neil. I greatly appreciated this.  :P |  | 
	
		| Back to top |         | 
	
		|  | 
	
		| Bluedog -
 
 
 Joined: 05 Jan 2003
 Posts: 179
 
 
 | 
			
				|  Posted: Tue Feb 11, 2003 10:19 pm    Post subject: |   |  
				| 
 |  
				| No problem ;) Need anymore help, you know where to find me. |  | 
	
		| Back to top |       | 
	
		|  | 
	
		|  |