Web Hosting Deals Holiday Logo Design Webcam Chat Website Header Templates Register domain Search Engine Optimisation Web Hosting
Go Back   Talk Mania Forum > Programming / Scripting / Coding

Programming / Scripting / Coding Got a question about : PHP / Perl / Java / JavaScript / CGI Scripts / JavaScript coding. Ask here! We'll get you the answers !

 Image
Buy Sell Downloads

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-27-2007, 01:21 AM
RGStrat's Avatar
Junior Member
 
Join Date: Apr 2007
Posts: 22
RGStrat is on a distinguished road
Smile Need Help...

I recently just purchased another domain in addition to my original one. However, I have 1 IP address on my server and need to know how to redirect based on the site keyed in the address bar.

For example: If I type in 'site_1.com' I want it to go to 'site_1.com/site_1'

OR

'site_2.com >>> site_2.com/site_2'

I would also prefer to do this without JS. Help?

__________________
-RGStrat
NEW WAVE APPAREL
Reply With Quote
  #2 (permalink)  
Old 09-27-2007, 12:44 PM
Senior Member
 
Join Date: May 2007
Posts: 181
Blog Entries: 1
skyfe is on a distinguished road
You can use redirection for t, for example with html:

Code:
<meta content='1; ur=site_1/' http-equiv='refresh'>
something like that, or you can use php;

Code:
<?php
header("Location: http://site_1.com/site_1/");
?>
and you can put one of these in the index.html or index.php (dephends on which you use).

But you should also be able to just change the root directory for the site.

Anyways, good luck ^^ Hope this helped
Reply With Quote
  #3 (permalink)  
Old 09-27-2007, 03:07 PM
RGStrat's Avatar
Junior Member
 
Join Date: Apr 2007
Posts: 22
RGStrat is on a distinguished road
Smile

Thanks so much! The problem is I have 2 sites and I need it to go to 2 directories depending on what URL they typed in. I have seen this done with Javascript but so far it has not worked for me. Thanks though!
Quote:
Originally Posted by skyfe View Post
You can use redirection for t, for example with html:

Code:
<meta content='1; ur=site_1/' http-equiv='refresh'>
something like that, or you can use php;

Code:
<?php
header("Location: http://site_1.com/site_1/");
?>
and you can put one of these in the index.html or index.php (dephends on which you use).

But you should also be able to just change the root directory for the site.

Anyways, good luck ^^ Hope this helped
__________________
-RGStrat
NEW WAVE APPAREL
Reply With Quote
  #4 (permalink)  
Old 09-28-2007, 01:53 AM
RGStrat's Avatar
Junior Member
 
Join Date: Apr 2007
Posts: 22
RGStrat is on a distinguished road
Any more suggestions?
__________________
-RGStrat
NEW WAVE APPAREL
Reply With Quote
  #5 (permalink)  
Old 09-30-2007, 06:54 PM
Junior Member
 
Join Date: Apr 2007
Posts: 2
Mambug is on a distinguished road
Uhh...Yeah. Use what Skyfe had suggested...

You put the meta data into an HTML file at site_1's index.html and site_2's index.html and they will forward your visitor to the appropriate destination.
Reply With Quote
  #6 (permalink)  
Old 10-09-2007, 12:21 PM
Junior Member
 
Join Date: Nov 2006
Posts: 9
doangia is on a distinguished road
How about .htaccess ?
Redirect 301 /old.html http://yoursite.com/new.html

__________________
Who Am I ?
Php tutorials collection
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +2. The time now is 06:26 PM.


Fake ID

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC8
Forums Copyright © Talk-Mania.com