Poin new domain from wildcard subdomain

andyajhis

Registered
Oct 23, 2018
1
0
1
Jakarta
cPanel Access Level
Website Owner
i have 2 domain.

example, i have an account cpanel for example.com.
and i was create Wildcard sub domain. any sub domain now available on example.com.

and my second domain example is example.net.

Now i want example.net access some wildcard domain from example.com. may be like hope.example.com.

i have been point A record from myhope.com to IP server example.com. Now i must to addon domain example.net to cpanel, but i cannot choose same folder like wildcard doamin.
What's should i do ?
 
Last edited by a moderator:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,269
313
Houston
Hello,

Can you explain the issue you're having with this configuration/what isn't working? I set this up on my server and was successfully redirected to the wildcard folder.

Here's what I did:

1. Created an account with domain mydomain.com
2. Created a wildcard subdomain with the document root _wildcard_
3. Added an index.html in the _wildcard_ folder that read "this is only a test"
4. Created an addon domain mydomain.net and used the _wildcard_ folder as the document root
5. queried mydomain.net to ensure i got the "this is only a test" response
Code:
curl -vv collin.net
* Rebuilt URL to: collin.net/
*   Trying <MYIPAddress>...
* TCP_NODELAY set
* Connected to mydomain.net (<MYIPAddress>) port 80 (#0)
> GET / HTTP/1.1
> Host: mydomain.net
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 25 Oct 2018 18:42:15 GMT
< Server: Apache
< Last-Modified: Thu, 25 Oct 2018 18:37:08 GMT
< Accept-Ranges: bytes
< Content-Length: 20
< Content-Type: text/html
<
This is only a test
* Connection #0 to host mydomain.net left intact
We can see I get the same response from the wildcard subdomain when queried I picked happy but you can use anything

Code:
curl -vv happy.mydomain.com
* Rebuilt URL to: happy.mydomain.com/
*   Trying <MyIPAddress>...
* TCP_NODELAY set
* Connected to happy.mydomain.com (<MyIPAddress>) port 80 (#0)
> GET / HTTP/1.1
> Host: happy.mydomain.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 25 Oct 2018 18:43:47 GMT
< Server: Apache
< Last-Modified: Thu, 25 Oct 2018 18:37:08 GMT
< Accept-Ranges: bytes
< Content-Length: 20
< Content-Type: text/html
<
This is only a test
* Connection #0 to host happy.mydomain.com left intact