Pointing domain2.com to sub.domain1.com

okihost

Registered
Mar 31, 2003
3
0
151
I have a customer who has setup a subdomain which is sub.domain.com he wants domain2.com to point to that subdomain. I have tried EVERYTHING I could think of and all posts here and have not figured it out yet.. Here is what I have the httpd.conf set like now for the subdomain tag.

<VirtualHost MY IP>
BytesLog domlogs/sub.domain.com-bytes_log
User admin1
Group admin1
ServerName domain2.org
ServerAlias sub.domain.com *.domain.com
ServerAdmin [email protected]
DocumentRoot /home/comprel/public_html/sub
CustomLog domlogs/sub.domain.com combined
ScriptAlias /cgi-bin/ /home/admin1/public_html/sub/cgi-bin/
User admin1
Group admin1
</VirtualHost>

I have even tried adding an A record for domain2.com in the zone file and nothing seems to work. It looks like it has happened to people before, but none of those fixes have worked for me yet. Thanks in advance.

cPanel.net Support Ticket Number:
 

mitul

Well-Known Member
Feb 8, 2003
291
0
166
You can write a simple php script with 'header location' to point all the request comming to the domain to that sumdomain.

cPanel.net Support Ticket Number:
 

steve248

Member
Apr 11, 2003
10
0
151
I would also love to be able to do this, I have no idea how to write this simple PHP script though, anyone any ideas?

cPanel.net Support Ticket Number:
 

NNNils

Well-Known Member
Sep 17, 2002
580
0
166
Why not edit his .htaccess file to forward to it?

cPanel.net Support Ticket Number:
 

vishal

Well-Known Member
Jan 28, 2003
340
0
166
India
Originally posted by NNNils
Why not edit his .htaccess file to forward to it?

cPanel.net Support Ticket Number:
Use a PHP Script with header:

pico index.php

<? header("Location:sub/index.php"); ?>
Save and Exit.

Hope this helps!

Regars,

cPanel.net Support Ticket Number:
 

Website Rob

Well-Known Member
Mar 23, 2002
1,504
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
Have you tried using the 'Add-on Doman' feature in Cpanel? This is exactly what it was designed for.

If 'domain2.com' is a properly registered Domain name, then there is no problem.

cPanel.net Support Ticket Number:
 

cjbyron

Member
Jun 30, 2003
6
0
151
Create a index.html file to put in the 1st domain that you want forwarded.

In that index file place:

<FRAMESET ROWS="*,0" FRAMEBORDER=0 BORDER=0 FRAMESPACING=0>
<FRAME SRC="http://domain2.com/" NORESIZE>
</FRAMESET>

with domain2 being where you want it to go to.

The above code should be placed in the "head" section of the html doc.

Plesk does this all for you, but not C-Panel. :(

cPanel.net Support Ticket Number: