How do I add a subdomain?
Adding a subdomain to your website can help organize different sections or services under your primary domain. Here’s a step-by-step guide on how to create a subdomain using cPanel:
#### Step 1: Log in to Your cPanel Account
1. **Access cPanel**:
- Navigate to your cPanel login URL, typically `yourdomain.com/cpanel` or a similar path provided by your hosting provider.
- Enter your username and password to log in.
#### Step 2: Navigate to Subdomains Section
1. **Find the Subdomains Tool**:
- In the cPanel dashboard, locate the "Domains" section.
- Click on "Subdomains" to open the subdomain management tool.
#### Step 3: Create the Subdomain
1. **Enter Subdomain Details**:
- **Subdomain**: In the "Subdomain" field, enter the name of the subdomain you want to create (e.g., `blog` for `blog.yourdomain.com`).
- **Domain**: Choose the primary domain from the dropdown menu if you have multiple domains.
- **Document Root**: The document root is the directory where files for the subdomain will be stored. cPanel will automatically suggest a default path, but you can change it if needed.
2. **Add the Subdomain**:
- Click the "Create" button to add the subdomain. cPanel will set up the necessary directories and configuration.
#### Step 4: Upload Files to the Subdomain
1. **Access File Manager**:
- Go back to the cPanel dashboard and click on "File Manager" in the "Files" section.
2. **Navigate to Subdomain Directory**:
- In the File Manager, navigate to the document root directory you specified for your subdomain (e.g., `public_html/blog`).
3. **Upload or Create Files**:
- You can upload files, create new files, or set up content for your subdomain in this directory.
#### Step 5: Test the Subdomain
1. **Check the Subdomain**:
- Open a web browser and enter the subdomain URL (e.g., `https://blog.yourdomain.com`) to ensure it is working correctly.
2. **Verify DNS Propagation**:
- DNS changes may take some time to propagate. If the subdomain does not appear immediately, wait a few hours and try again.
### Additional Tips
- **DNS Settings**:
- Ensure that your domain’s DNS settings are correctly configured to include an "A" record for the subdomain if needed. cPanel usually handles this automatically, but it’s good to verify.
- **SSL Certificates**:
- If your primary domain uses SSL, you may need to secure your subdomain with an SSL certificate. Check with your hosting provider if you need to add or configure SSL for your subdomain.
- **Redirects and Aliases**:
- If you want the subdomain to redirect to another site or URL, you can set up a redirect in the "Redirects" section of cPanel.
By following these steps, you can effectively create and manage subdomains for your website, allowing for better organization and functionality.