PDA

**See This Page With Full Graphics, Pictures and Color!** CLICK HERE --> : Domain naming question


Arc Lite
06-10-2008, 10:02 PM
Okay, so I do the website for the county where I work. But what I'm wanting to do is something I've seen here and there on the internets. So for example, I have a department website "gis" that's currently: www.jaspercounty.org/gis

But what I'd like it to be is: gis.domainname.org

Is this something that's set up on the server side of things? If yes how difficult? I'm assuming that since we are paying for hosting that is something they should know how to set up. But we will eventually be hosting our own site, so I'd like to be familiar with the process.

Thanks

blazin
06-10-2008, 10:24 PM
Thats called a subdomain. Many ISP's will offer these to you with your hosting package.

If your host gives you a control panel, you can set it up there, otherwise you'd probably have to ask them to set it up for you.

When you run your own webserver and manage it, it may be a bit more difficult. It will depend on whether you use a Windows or Unix box.

Teddy
06-11-2008, 12:57 AM
if you have paid hosting then yes its called a subdomain and should be as simple as loging into the control panel and adding a subdomain if your hosting your own a server their are a few ways to do it.

i normally add an a pointer (host pointer) in bind or windows dns that is say gis.example.com to the ip of the web server then i go to apache and add a virtual host (you can do this in any web server i just use apache)

if you use apache the virtual host looks something like this

<VirtualHost *:80>
ServerName gis.example.com
ServerAlias gis.example.com *.gis.example.com
DocumentRoot /local/path/to/html/folder/gis
ServerAdmin webmaster@gis.example.com
UseCanonicalName Off
ScriptAlias /cgi-bin/ "/path/to/cgi-bin/"
<Directory "/path/to/cgi-bin/">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

roche
06-11-2008, 01:03 AM
if you have paid hosting then yes its called a subdomain and should be as simple as loging into the control panel and adding a subdomain if your hosting your own a server their are a few ways to do it.

i normally add an a pointer (host pointer) in bind or windows dns that is say gis.example.com to the ip of the web server then i go to apache and add a virtual host (you can do this in any web server i just use apache)

if you use apache the virtual host looks something like this

<VirtualHost *:80>
ServerName gis.example.com
ServerAlias gis.example.com *.gis.example.com
DocumentRoot /local/path/to/html/folder/gis
ServerAdmin webmaster@gis.example.com
UseCanonicalName Off
ScriptAlias /cgi-bin/ "/path/to/cgi-bin/"
<Directory "/path/to/cgi-bin/">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

He is 95% correct. All that he missed was the fact you need to set up an A record on your DNS server for that subdomain.

Oh, and that about will only work if your webhost is running Apache and the directories match up.

Teddy
06-11-2008, 01:26 AM
well my dns server is my webserver so :-p

also if he has a web host it should be a few clicks in cpanel or plesk and that will automatically alter the config files for him which is the great part about those gui control panels if you are offering a hosting service but i don't have any of that stuff installed on my dedicated server so i have to do it by hand

i can get you directions for iis too but its alot easier in iis beacuse of the gui

roche
06-11-2008, 01:29 AM
well my dns server is my webserver so :-p

Ahhh... You know I am just busting your balls. :action-sm

Arc Lite
07-01-2008, 12:50 PM
Thanks guys. Our hosting company had all that covered in the control panel. But I have a follow up. (that might be covered in what Teddy said, I'm not sure)

I have set up the subdomain of gis.jaspercounty.org (and others) but what I want is that if someone still types in www.jaspercount.org/gis it will redirect (I guess) to the subdomain, gis.jaspercounty.org

Thanks

Edit: Nevermind. The hosting control panel has a tool for this that makes it a no-brainer.

Dilly
07-08-2008, 12:02 PM
there is an easy way, using webhop http://www.dyndns.com/services/webredirect/

basically automatically redirects for you without any coding on your part.

or use this code

Redirect code

To create an HTML redirect, place the following code between the head tags.
<meta http-equiv="Refresh" content="5; url=/html/tags.cfm">

In the above example, the page will redirect to the specified page in 5 seconds (as indicated in the content attribute.

or javascript code

To create a JavaScript redirect, place the following code between the head tags of your HTML page (replacing the URL with the URL that you want to redirect to).

<script type="text/javascript">
<!--
window.location = "http://www.quackit.com"
//-->
</script>

In the above example, the page will only redirect if the user has JavaScript enabled on their browser.