What is Subdomain
A subdomain is a domain that is part of a larger main domain (or parent domain). It is used to organize and navigate to different sections of a website, often representing different areas or functions. Subdomains are created by adding a prefix to the main domain name, separated by a dot.
Table of Contents
Example Structure:
- Main Domain:
example.com
- Subdomains:
blog.example.com
store.example.com
support.example.com
Uses of Subdomains:
- Organization of Content: Subdomains help in organizing different sections of a website. For example, a blog could be hosted on
blog.example.com
while the main site remains onexample.com
. - Separate Functionality: Subdomains can be used to separate different functionalities of a website. For instance, an online store could be on
shop.example.com
, while the main site provides information about the company. - Localization: Subdomains can be used for different language versions of a website. For instance,
en.example.com
for English,fr.example.com
for French, and so on. - Testing and Development: Subdomains are often used for testing and development purposes, such as
dev.example.com
orstaging.example.com
.
Resolving A Subdomain Not Working Issue in cPanel
If you’re facing an issue where a subdomain is not working in cPanel, there are several potential causes and corresponding troubleshooting steps to resolve the issue. Here’s a step-by-step guide:
1. Verify Subdomain Creation
- Log in to cPanel.
- Go to Domains > Subdomains.
- Ensure that the subdomain is correctly listed and points to the correct document root (the folder where its files are stored).
2. Check DNS Settings
- Ensure that the DNS record for the subdomain is correctly configured.
- Navigate to Domains > Zone Editor in cPanel.
- Look for an A record (or CNAME record, depending on your setup) for the subdomain. Ensure it points to the correct IP address of your server.
- If no record exists, add an A record with the subdomain pointing to your server’s IP address.
3. Allow DNS Propagation
- DNS changes can take time to propagate. If you’ve recently added or modified the DNS record, it might take up to 48 hours to fully propagate worldwide.
- You can use tools like What’s My DNS to check the DNS propagation status.
4. Check .htaccess Configuration
- If you’re using an
.htaccess
file in the subdomain’s root directory, ensure that there are no rules that might block access to the subdomain. - Common issues might include incorrect redirect rules or permission settings.
5. Verify the Web Server Configuration
- If you have root access to the server, ensure that the web server (e.g., Apache, Nginx) is configured to handle the subdomain correctly.
- Check the server’s configuration files (e.g.,
httpd.conf
ornginx.conf
) to make sure the subdomain is correctly set up.
6. Check File Permissions
- Ensure that the files in the subdomain’s document root have the correct permissions.
- Files typically should have
644
permissions, and directories should have755
permissions.
7. Clear Browser Cache
- Sometimes, the issue might be local. Clear your browser’s cache and cookies or try accessing the subdomain from an incognito/private window.
8. Test with a Different Network
- The issue could be due to local DNS caching. Try accessing the subdomain from a different network (e.g., mobile data) to see if it’s working.
9. Check Firewall Settings
- If your server has a firewall, ensure that it’s not blocking access to the subdomain.
- You may need to check with your hosting provider if you’re unsure about the firewall configuration.
10. Contact Support
- If you’ve tried the above steps and the subdomain is still not working, consider contacting your hosting provider’s support for further assistance.