How to add a prefix to my domain name?

34,337

Solution 1

You would need to do two things,

One: You will need to create the sub-domains in your DNS. You will use a CNAME (alias) for this. For example.

Creating a CNAME for www.example.com that points to example.com is how www is added to a domain. You will be doing essentially the same thing.

In your case, you would create a CNAME for...

cl.example.com pointing to example.com

and then...

www.cl.example.com pointing to example.com

This ties these sub-domains to an IP address so that any request knows where to go.

Two: On your web server, you will need to create a website for cl.example.com. I assume you are using a control panel. cPanel is the most popular. I am unfamiliar with this so you may need to poke around a bit or call your webhost if the interface is not clear. When you create your website, you will also be creating an alias of www.cl.example.com for cl.example.com. This is standard stuff.

Here is the documentation for how to do this in cPanel: https://documentation.cpanel.net/display/ALD/Subdomains -- it uses a more user friendly language and may not exactly line-up with the terms I used in the previous paragraph. The cPanel documentation leaves a lot to be desired.

If you are familiar with working with configuration files, I can edit this answer for instructions to give you a good start. If you are not familiar with configuring a website this way, I suggest just dealing with the control panel. I know Apache and not Nginx or IIS. It would be helpful to know what software you are using for your web server.

Solution 2

it's called a subdomain. You would add it in cpanel - or whatever management panel you have.

Share:
34,337
CPPBro
Author by

CPPBro

Updated on September 18, 2022

Comments

  • CPPBro
    CPPBro over 1 year

    How do I add something like 'www.CI.domain.com' or 'www.SOMETHING.domain.com'

    I am pretty sure its probably something to do with my DNS but how would I get it to point to that specific page?

    Basically I just want to set up a directory on my site where I can host my project files and use a .htaccess to protect it.

    • CPPBro
      CPPBro about 9 years
      Installing CPanel right now. I didnt want to use it but it seems like the easiest thing to do.
  • CPPBro
    CPPBro about 9 years
    Ah! But what if I don't have a management panel?
  • CPPBro
    CPPBro about 9 years
    I know what to do now! For some reason my mind went blank and I couldn't think of the word 'subdomain'! I just installed CPanel and got it set up! Thanks a ton!
  • Steve
    Steve about 9 years
  • closetnoc
    closetnoc about 9 years
    @Will Anytime!! We all draw a blank from time to time. Wait till you get old!! You get to really have some fun with it!