Jump to content

[SOLVED] adding prefix to website


peranha

Recommended Posts

A server has an ip address.  You can go directly to your site by entering in the ip address in the address bar.  If you would like to be able to do www.mydomain.com you need to register a domain name and have it point to your server.  Your server/apache/whatever does not do this automatically.  Basically a domain name is a "nickname" for your server. You pay some registrar domain name service money to reroute requests to mydomain.com to your ip. 

 

Now, SUB domains are done on your server.  You would do that in cpanel or wherever. 

Link to comment
Share on other sites

I am registered with Website website with godaddy, and I am hosting on my own server at my house.  i would like to add test.Website.com.  do I have to register this with godaddy, as well??  I dont have a cpanel installed on my server, so I am woundering if there is another way, or if not, what type of cpanel do you recommend??

Link to comment
Share on other sites

<VirtualHost *:8204>
  DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek"
  ServerName localhost
</VirtualHost>
<VirtualHost *:8204>
  DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek/test"
  ServerName test.localhost
</VirtualHost>

Link to comment
Share on other sites

yes I have, when i go to test.localhost and localhost, they both go to

 

"C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek"

 

which is localhost.  It will not got to localhost/test when I go to test.localhost not sure why.

Link to comment
Share on other sites

This is my hosts file as well

 

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
127.0.0.1	test.localhost

Link to comment
Share on other sites

It works now, after a couple of more restarts.

 

here is my vhosts file in apache

 


<VirtualHost *:8204>
  DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek"
  ServerName localhost
</VirtualHost>
<VirtualHost *:8204>
  DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/mberanek/test"
  ServerName test.localhost
</VirtualHost>

 

and this is my hosts file in windows

 

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost
127.0.0.1	test.localhost

 

Not sure why it didnt work after the first restart, but it finally does.  Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.