Forwarding Subdomains

  • blink182av
  • Guru
  • Guru
  • blink182av
  • Posts: 1258
  • Loc: New York

Post 3+ Months Ago

I have a domain: xyz-effect.net
What I would like to do is create subdomains that forward to a Counter-Strike IP and a Ventrilo IP (http://www.ventrilo.com). I have the subdomains set to cs.xyz-effect.net and vent.xyz-effect.net. I can't figure out how to forward it all correctly, Please help me!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Mephistox
  • Beginner
  • Beginner
  • Mephistox
  • Posts: 62

Post 3+ Months Ago

you can do this with a PHP index page or .htaccess.

1) Index page
Simply create index.php in the directory you want to act as a fowarding page/redirect and include the following code:
PHP Code: [ Select ]
<?php
 
header("Location: PUT YOUR IP HERE");
 
?>
 
 
  1. <?php
  2.  
  3. header("Location: PUT YOUR IP HERE");
  4.  
  5. ?>
  6.  
  7.  


2) .htaccess
Create a .htaccess file and include the following code:
Code: [ Select ]
Redirect URL-THAT-WILL-BE-DOING-THE-REDIRECT URL-THAT-WILL-BE-DIRECTED-TO

Note that there are 3 parts to that, which should all be on one line : the Redirect command, the location of the file/directory you want redirected relative to the root of your site (/olddirectory/oldfile.html = yoursite.com/olddirectory/oldfile.html) and the full URL of the location you want that request sent to. Each of the 3 is separated by a single space, but all on one line. You can also redirect an entire directory by simple using Redirect /olddirectory http://yoursite.com/newdirectory/
  • blink182av
  • Guru
  • Guru
  • blink182av
  • Posts: 1258
  • Loc: New York

Post 3+ Months Ago

You may have misunderstood, this is a subdomain not a directory. I also need it to work for these 2 programs. It does not work with CPanel.
  • GT500Shlby
  • Guru
  • Guru
  • User avatar
  • Posts: 1205
  • Loc: Philadelphia, PA

Post 3+ Months Ago

You running the DNS or is it elsewhere run?

Just set the fully qualified subdomian to the correct IP. Let it propagate or just drop the TTL to 1.
  • blink182av
  • Guru
  • Guru
  • blink182av
  • Posts: 1258
  • Loc: New York

Post 3+ Months Ago

I guess I need new hosting :\
  • CartikaHosting
  • Proficient
  • Proficient
  • CartikaHosting
  • Posts: 455
  • Loc: Wishing I was in Kicking Horse

Post 3+ Months Ago

Quote:
I guess I need new hosting :\


LOL - no - we were given a way to do this.

However, if you want to do this from a GUI and a control panel - find a host that offers true multiple domain hosting - vs the add-on domain and sub folder garbage cpanel comes up with

try

http://www.hspherehosts.com
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

OK, I'm thinking if I'm reading this correctly, and assuming I finally understand htaccess a bit, try adding this under ReriteEngine On in your .htaccess file.

Code: [ Select ]
RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
RewriteRule ^(.*)$ http://subdomain.yourdomain.com/$1 [R=301,L]
  1. RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
  2. RewriteRule ^(.*)$ http://subdomain.yourdomain.com/$1 [R=301,L]


//edit - *hmmm that's not quite right given what I just reread in your post, but it's the right idea.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Skip the above. Let's break that down.

Code: [ Select ]
RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
RewriteRule ^(.*)$ http://subdomain.yourdomain.com/$1 [R=301,L]
  1. RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
  2. RewriteRule ^(.*)$ http://subdomain.yourdomain.com/$1 [R=301,L]


Let's switch that to my current htaccess

Code: [ Select ]
RewriteCond %{HTTP_HOST} ^boastingrights\.com$ [NC]
RewriteRule ^(.*)$ http://www.boastingrights.com/$1 [R=301,L]
  1. RewriteCond %{HTTP_HOST} ^boastingrights\.com$ [NC]
  2. RewriteRule ^(.*)$ http://www.boastingrights.com/$1 [R=301,L]


OK, so the result of that redirect is that if a user types boastingrights.com they get redirected to http://www.boastingrights.com

So applying that to your scenario I'm almost thinking you need two rules.
Code: [ Select ]
RewriteCond %{HTTP_HOST} ^cs.xyz-effect\.net$ [NC]
RewriteRule ^(.*)$ http://cs-IP-goes-here/$1 [R=301,L]
  1. RewriteCond %{HTTP_HOST} ^cs.xyz-effect\.net$ [NC]
  2. RewriteRule ^(.*)$ http://cs-IP-goes-here/$1 [R=301,L]

and
Code: [ Select ]
RewriteCond %{HTTP_HOST} ^vent.xyz-effect\.net$ [NC]
RewriteRule ^(.*)$ http://www.ventrilo.com/$1 [R=301,L]
  1. RewriteCond %{HTTP_HOST} ^vent.xyz-effect\.net$ [NC]
  2. RewriteRule ^(.*)$ http://www.ventrilo.com/$1 [R=301,L]


I'm hoping that somebody else better versed in htaccess redirects can correct me if that's in error, but It's got to be pretty close. I'm thinking logically and have no way to test it for you.
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

blink182av wrote:
I have a domain: xyz-effect.net
What I would like to do is create subdomains that forward to a Counter-Strike IP and a Ventrilo IP (http://www.ventrilo.com). I have the subdomains set to cs.xyz-effect.net and vent.xyz-effect.net. I can't figure out how to forward it all correctly, Please help me!


So let me see if I get this straight; you have the subdomains in your DNS, like this:
(In the xyz-effect.net zone)
cs IN A <IP>
vent IN A <IP>

Where the ip's point to your IP?

If you know the IP's for those (when I say that, I mean of course ensuring there's no round-robin IP scheme, or global load balancing) it should be simply a matter of placing those IP's in your zone's DNS. Alternatively, you could use a cname as well

cs IN CNAME <full address of CS site ending in a period (.)>
vent IN CNAME http://www.ventrilo.com.

Then, any traffic that is resolved at your DNS server for cs.xyz-effect.net will go to the other, as will the vent 'subdomain'.

Or did I just misunderstand the problem?
  • GT500Shlby
  • Guru
  • Guru
  • User avatar
  • Posts: 1205
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Blink bought a domain. He set up nameservers with the domain registrar for the root servers. However he never set up any DNS servers. The company that runs the DNS hosting is a fly-by-night and the guy never set it up.

All he has to do is change the nameservers on the registrars root server which is easy and web-based and should only take between 20 minutes to 24 hours to propagate.

The nameservers would be of a nicer company that has some web-based DNS setup so he can point all of his nice subdomains to all of his servers.

And then give me Dont.ph34r.the.abc.ph34r.the.xyz-effect.net :twisted:
  • GT500Shlby
  • Guru
  • Guru
  • User avatar
  • Posts: 1205
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Actually I have a redirect problem too. I have a trac server running on gentoo linux at work and I wanted to point index.html to /cgi-bin/trac.cgi but through messing with it I fudged up apache hardcore. I get a 404 error for the / directory. because I started messing with the username apache runs on and chown'd a bunch of other stuff.

I might have to rm -rf apache and recompile it to fix. Thankfully its development and not a production server - production would have been messy!
  • blink182av
  • Guru
  • Guru
  • blink182av
  • Posts: 1258
  • Loc: New York

Post 3+ Months Ago

The man who hosts my domain did it for free. He is the same man that I ordered all of my parts from. You can read about him here: http://www.ozzu.com/general-discussion/sad-news-t56337.html . So this is related to DNS, not HTTP forwarding.
  • mysticalfairy
  • Newbie
  • Newbie
  • mysticalfairy
  • Posts: 5

Post 3+ Months Ago

I would use .htaccess

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: johnw10 and 20 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.