Hi
@roadpaperweight
Was example.net already added to the account prior to making these changes? Can you show me the contents of the following of course switching the domain names to example.com and example.net before posting:
Code:
grep DNS /var/cpanel/users/$username
cat /var/cpanel/userdata/$username/main
Thanks for the response.
The original domain was example.com. The new domain is example.net. What I did was modify account > changed the domain name to example.net which had never been on the server before. I then parked example.com.
grep DNS /var/cpanel/users/$user output
DNS=example.net
DNS1=example.com
cat /var/cpanel/userdata/$username/main output
---
addon_domains: {}
main_domain: example.net
parked_domains:
- example.com
sub_domains: []
I also went to redirect-checker.org/ to see what is says and for the new domain, example.net it gave me
>>> example.net
Code:
> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------
[B]Status:[/B] 301 Moved Permanently
[B]Code:[/B] 301
[B]Date:[/B] Wed, 11 Apr 2018 17:55:44 GMT
[B]Server:[/B] Apache
[B]X-Pingback:[/B] http://example.com/xmlrpc.php
[B]Upgrade:[/B] h2,h2c
[B]Connection:[/B] Upgrade, close
[B]Location:[/B] https://example.com/
[B]Content-Type:[/B] text/html; charset=UTF-8
>>> example.com
Code:
> --------------------------------------------
> 200 OK
> --------------------------------------------
[B]Status:[/B] 200 OK
[B]Code:[/B] 200
[B]Date:[/B] Wed, 11 Apr 2018 17:55:46 GMT
[B]Server:[/B] Apache
[B]X-Pingback:[/B] https://example.com/xmlrpc.php
[B]Link:[/B] https://example.com/wp-json/; rel="", <[URL='https://example.com/>; rel=shortlink
[B]Upgrade:[/B] h2,h2c
[B]Connection:[/B] Upgrade, close
[B]Content-Type:[/B] text/html; charset=UTF-8
and for the original, now parked domain, example.com, it gave me
Code:
>>> http://www.example.com
[code]
> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------
[B]Status:[/B] 301 Moved Permanently
[B]Code:[/B] 301
[B]Date:[/B] Wed, 11 Apr 2018 17:58:16 GMT
[B]Server:[/B] Apache
[B]X-Pingback:[/B] http://example.com/xmlrpc.php
[B]Upgrade:[/B] h2,h2c
[B]Connection:[/B] Upgrade, close
[B]Location:[/B] https://example.com/
[B]Content-Type:[/B] text/html; charset=UTF-8
>>> example.net
Code:
> --------------------------------------------
> 200 OK
> --------------------------------------------
[B]Status:[/B] 200 OK
[B]Code:[/B] 200
[B]Date:[/B] Wed, 11 Apr 2018 17:58:19 GMT
[B]Server:[/B] Apache
[B]X-Pingback:[/B] https://example.com/xmlrpc.php
[B]Link:[/B] <https://example.com/wp-json/>; rel="", <[URL='https://example.com/>; rel=shortlink
[B]Upgrade:[/B] h2,h2c
[B]Connection:[/B] Upgrade, close
[B]Content-Type:[/B] text/html; charset=UTF-8
In WHM it definitely shows example.net to be the primary domain of the user domain. It also shows example.com to be parked under example.net.
I hope this is everything you need. I don't understand why this redirect is happening. Thanks again for your help.