# Subdomain

**URL:** <https://forums.interworx.com/t/subdomain/13911>\
**Category:** General Discussion\
**Tags:** subdomain\
**Created:** [October 28, 2015, 5:39am UTC](https://forums.interworx.com/t/subdomain/13911 "2015-10-28T05:39:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shyuan](https://forums.interworx.com/user_avatar/forums.interworx.com/shyuan/32/22_2.png) [@Shyuan](https://forums.interworx.com/u/Shyuan)\
**Post date:** [October 28, 2015, 5:39am UTC](https://forums.interworx.com/t/subdomain/13911/1 "2015-10-28T05:39:44Z")

</div>

Hi there,

I’ve created a subdomain using “Add a Subdomain” in Siteworx, but if you visit [sub.domain.com](http://sub.domain.com), it won’t load. Instead, it will load when you visit it as a subdirectory i.e. [domain.com/sub](http://domain.com/sub). Do you guys have any idea what went wrong? I didn’t touch any conf files or whatsoever. This is a newly set up server which I am still importing my cPanel accounts.

Any help would be much appreciated. Thank you! 🙂

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [October 28, 2015, 6:18am UTC](https://forums.interworx.com/t/subdomain/13911/2 "2015-10-28T06:18:01Z")

</div>

Hi shyuan

Hope your well

I think it might 1 or both of my thoughts as follows

The DNS has not populated fully for the subdomain created ie your using cache DNS from your connection DNS

If on centos 7, have you manually restarted Apache

Your reference for sub domain is correct, so that has been created correctly, which is why I believe it is DNS

I hope that makes sense

Many thanks

John

---

<div class="post-metadata">

**Author:** ![Shyuan](https://forums.interworx.com/user_avatar/forums.interworx.com/shyuan/32/22_2.png) [@Shyuan](https://forums.interworx.com/u/Shyuan)\
**Post date:** [October 28, 2015, 7:40am UTC](https://forums.interworx.com/t/subdomain/13911/3 "2015-10-28T07:40:24Z")

</div>

Hi John,

I can confirm it’s not about DNS.

I have a file.php uploaded into the [sub.domain.com](http://sub.domain.com). By right, if I access [sub.domain.com/file.php](http://sub.domain.com/file.php), it has to show something, but it says not found. Tried uploading index.html and access [sub.domain.com/index.html](http://sub.domain.com/index.html), it says not found too. Whereas if i visit [domain.com/sub/file.php](http://domain.com/sub/file.php) and [domain.com/sub/index.html](http://domain.com/sub/index.html) they are able to show the correct things.

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [October 28, 2015, 7:49am UTC](https://forums.interworx.com/t/subdomain/13911/4 "2015-10-28T07:49:25Z")

</div>

Hi shyuan

Many thanks, and sorry I don’t think I’m clear over my reply

If you ping the subdomain, does it resolve correctly to the IP address

If it states not found, it’s DNS population in your broadband connection DNS or you could try flushing your DNS cache

If it resolves correctly to the IP address then it’s something else, and if so, do you see forbidden 403 when trying to reference subdomain in a browser

If you want to pm the domain and subdomain, I could run a check from here and let you know

Many thanks

John

---

<div class="post-metadata">

**Author:** ![Bummer](https://forums.interworx.com/user_avatar/forums.interworx.com/bummer/32/11_2.png) [@Bummer](https://forums.interworx.com/u/Bummer)\
**Post date:** [October 28, 2015, 11:49am UTC](https://forums.interworx.com/t/subdomain/13911/5 "2015-10-28T11:49:11Z")

</div>

To verify if it’s the DNS or not, why don’t you change the hosts file on your computer. You’d then know if the DNS had resolved correctly or not.

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [October 28, 2015, 12:09pm UTC](https://forums.interworx.com/t/subdomain/13911/6 "2015-10-28T12:09:19Z")

</div>

Hi Kent

Many thanks, and sorry I’m not explaining very well

I did not mean on the server DNS

I was meaning the Internet connection used by shyuan to reference the subdomain The Internet provider DNS is not fully live DNS but cached DNS once a request is made. So if the request was made too soon before populated, it will cache the null response until cache cleared or updated, just as a PC DNS cache would.

Another way to overcome this, would be to set your PC DNS servers say to google.

I hope this makes more sense

On another point, any chance you could update your centos 7 post with how you got on.

Many thanks

John

---

<div class="post-metadata">

**Author:** ![Shyuan](https://forums.interworx.com/user_avatar/forums.interworx.com/shyuan/32/22_2.png) [@Shyuan](https://forums.interworx.com/u/Shyuan)\
**Post date:** [October 28, 2015, 12:32pm UTC](https://forums.interworx.com/t/subdomain/13911/7 "2015-10-28T12:32:53Z")

</div>

Hi John,

It seems a mere restart of the service fixed the issue. And you were right I was on CentOS 7. But i do wonder is it a bug or is it a must to do that every time I add a subdomain? Appreciate your time to explain if you know 🙂

---

<div class="post-metadata">

**Author:** ![Bummer](https://forums.interworx.com/user_avatar/forums.interworx.com/bummer/32/11_2.png) [@Bummer](https://forums.interworx.com/u/Bummer)\
**Post date:** [October 28, 2015, 12:36pm UTC](https://forums.interworx.com/t/subdomain/13911/8 "2015-10-28T12:36:53Z")

</div>

Hey John,

I’ve had several clients that had problems with Google DNS servers not updating and being cached as recently as a month ago. Don’t know why and I was surprised. I figured if Shyuan changed the hosts file on his PC, he would know if things were working properly by if it came up correctly as [sub.domain.com/index.html](http://sub.domain.com/index.html). If it didn’t, then I’d assume the issue would be with his server.

Sorry, I’m not sure, what are you asking on teh CentOS 7 post on how I got on? I can be dense at times!

Thanks,  
Kent

---

<div class="post-metadata">

**Author:** ![Bummer](https://forums.interworx.com/user_avatar/forums.interworx.com/bummer/32/11_2.png) [@Bummer](https://forums.interworx.com/u/Bummer)\
**Post date:** [October 28, 2015, 12:44pm UTC](https://forums.interworx.com/t/subdomain/13911/9 "2015-10-28T12:44:55Z")

</div>

Hey Shyuan,

Right now, you restart the service every time you add a domain or subdomain. It’s not supposed to work this way, it’s a bug. But John should be able to confirm this.

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [October 28, 2015, 12:49pm UTC](https://forums.interworx.com/t/subdomain/13911/10 "2015-10-28T12:49:00Z")

</div>

Hi Kent and shyuan

Yes, it’s a known bug in centos 7, which their working on. It’s in the code for service restart which is different in centos 7, but you cannot just add it in, as one exists and this stops it I think.

Sorry Kent, my mistake, I did not think you meant shyuan PC, rather host on server sorry, so we were both thinking same.

Your update was for the centos 7 you were going to play with over the weekend, I think you posted on mikes post

Glad it’s resolved though, and hopefully should be fully working soon on centos 7.

Many thanks

John

---

<div class="post-metadata">

**Author:** ![Bummer](https://forums.interworx.com/user_avatar/forums.interworx.com/bummer/32/11_2.png) [@Bummer](https://forums.interworx.com/u/Bummer)\
**Post date:** [October 28, 2015, 1:54pm UTC](https://forums.interworx.com/t/subdomain/13911/11 "2015-10-28T13:54:26Z")

</div>

Hey John,

I’m good at thinking other people can read my mind. You must have a memory like a steel trap in remembering me from another post. 🙂

As a matter of fact, I’m going down to the data center tomorrow evening to install CentOS on a server. I then plan on setting it up with Interworx no later than this weekend. Once all is installed and updated, I’m going to put on a few websites to see if everything works okay. I’m okay with having to restart the service or services via command line or Interworx, it’s just a minor annoyance. Hopefully all will go well.

Thanks for asking!

Regards,  
Kent
