How To Create A Subdomain
A subdomain is a custom name you add in front of your main website address, like blog.example.com or store.example.com. You can use it to organize different parts of your site. Just like a regular domain, you can point it to a folder and run a separate website on it.
How To Create a Subdomain
- Log in to your Bluehost Account Manager.
- Click Hosting in the left-hand menu.
The details of your hosting plan will be displayed.
- Click on cPanel.
- From the cPanel, click on the Domain Names icon. Click Domains.
- Click the Create a New Domain button.
- Input the desired subdomain name you want to create in the Domain field.
- Uncheck the option "Share document root (/home/username/public_html) with domain.tld."
- Choose the directory for the website you want to show, ideally named after your subdomain. Then click Submit.
Hosting Only A Subdomain
- In Bluehost, create an account with the domain name you purchased elsewhere.
If you are setting up the domain subdomain.example.com, sign up for your account with the name example.com
- In your Bluehost cPanel, create the subdomain you need to host with us (i.e., "subdomain.example.com.")
- Contact the host of your domain name's zone file and have them point the A record for the subdomain to the IP of your server.
Restrict Subdomain Access to Addon Domains
Each addon domain requires a subdomain. Using mod_rewrite, you can stop people from using the addon domain as a subdomain of the primary domain.
Put this in the .htaccess file located in the subdomains folder, changing the subdomain, primarydomain.com, and addondomain.com:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain.primarydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.subdomain.primarydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^addondomain.com$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://www.addondomain.com/ [R=301,L]
Summary
Creating a subdomain is an easy way to organize your website and improve how you manage it. It helps keep your site structured and makes your online presence more efficient. It will require logging into your Bluehost account, navigating to cPanel, and selecting the Domain Names section to configure your desired subdomain and its directory..
For exclusive subdomain hosting, ensure the domain's A record points to your server's IP. Additionally, restrict access to addon domains by configuring .htaccess in your subdomain's folder.
If you need further assistance, feel free to contact us via Chat or Phone:
- Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
- Phone Support -
- US: 888-401-4678
- International: +1 801-765-9400
You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.