Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2014
    Location
    Iran, Lorestan, Delfan
    Posts
    9

    Add hosting to another as a subdomain

    Hello!
    I have a question.
    I have a website, I wanna deploy it, can I buy hosting and add it to my website as a subdomain like new.mywebsite.com? How? (explain briefly).

  2. #2
    Join Date
    May 2012
    Location
    Canada
    Posts
    100
    Yes, but your current host for your website should be able to handle the subdomain as well, no? But yes, if the question is can you direct a subdomain to another host. If you can clarify if this is what you meant!
    IroncladServers.ca - Shared.Reseller.VPS.Dedi.Colo
    Solid Canadian & US network, 24.7.365 support, 100% owned & maintained

  3. #3
    Join Date
    Aug 2003
    Location
    Taiwan
    Posts
    1,061
    @miladrahimi93, most hosting provider provide control panel these days and once you get a domain with hosting, you should be able to create own subdomain.
    www.hostinginside.com
    Taiwan Dedicated Server
    Taiwan, US, UK & Germany XEN Based VPS with RAID 10

  4. #4
    Join Date
    Feb 2006
    Posts
    4,799
    This shouldn't be a problem at all. You'll need to create an A record in the primary DNS zone for your domain. There are some hosting providers that will not allow the creation of subdomans based on domains not hosted on the server, be sure to ask potential providers about this.
    WHMEasyBackup.com - Take Control Of Your Backups!
    Complete Backup Solution For WHM Reseller Accounts
    Download Trial

  5. #5

    A Record

    You need to add an A Record for the same and wait for sometime to resolve

  6. #6
    Join Date
    Feb 2014
    Location
    Iran, Lorestan, Delfan
    Posts
    9

    Programming aspect!

    Thank you for your answers.
    I meant can I encounter with it like a folder in my main host where I programming in PHP?
    My subdomains have a folders with the same names in root of my website (public_html, www or htdocs, so I can copy my files into them easily as kiss(!), it's my question, can I encounter with it like a folder in my main host where I programming in PHP?

  7. #7
    Join Date
    May 2012
    Location
    Canada
    Posts
    100
    Yes, you'd be able to access the folder by browsing through your main domain as well by default (instead of accessing it from your subdomain), if the subdomains files are contained within a subfolder of your public_html/htdocs/www (whichever it may be) folders. You can avoid this by adding an entry in your main .htaccess file in the public_html folder.

    Something like this:
    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^maindomain.com [nc]
    RewriteRule ^subfolder/(.*)$ / [r=403,nc]
    Instead of 403 above (which means forbidden), you could put 404 as not found, or you could make this into a 301 redirect which would redirect visitors to the subdomain instead of browsing through the folder on your main domain.
    Last edited by ironclad; 02-08-2014 at 09:08 PM.
    IroncladServers.ca - Shared.Reseller.VPS.Dedi.Colo
    Solid Canadian & US network, 24.7.365 support, 100% owned & maintained

Similar Threads

  1. Plesk 10.4: How to add a subdomain?
    By [Axelsson] in forum Web Hosting
    Replies: 2
    Last Post: 02-28-2012, 04:33 AM
  2. How can you add subdomain CName
    By sunsoft in forum Dedicated Server
    Replies: 3
    Last Post: 08-18-2010, 01:17 PM
  3. Creating same subdomain name/directory on add-on
    By hbhb in forum Hosting Security and Technology
    Replies: 1
    Last Post: 08-20-2007, 02:30 AM
  4. Add-on Domain and Subdomain
    By SephirothJC in forum Hosting Security and Technology
    Replies: 7
    Last Post: 07-20-2007, 02:17 PM
  5. Add Subdomain
    By kiswd in forum Hosting Security and Technology
    Replies: 3
    Last Post: 08-31-2004, 04:05 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •