Bart
Member
Registered: 19th Aug 02
Location: Midsomer Norton, Bristol Avon
User status: Offline
|
I have a domain, www.mydomain.co.uk
Id like to resolve an address: bart.mydomain.co.uk to forward to a directory, i.e www.mydomain.co.uk/bart
Is this possible? Ive tried cnames etc, but they dont appear to like "/"
|
Whittie
Member
Registered: 11th Aug 06
Location: North Wales Drives: BMW, Corsa & Fiat
User status: Offline
|
Edit: I've just tried it and it worked fine, how are you doing it?
Edit 2: Actually what are you trying to achieve? Just a sub-domain?
http://bart.winablackberryplaybook.co.uk/ - Directory was public_html/bart/index.html.
Guessing you're trying to do something with your email, and not sub-domain?
[Edited on 28-06-2012 by Whittie]
|
VrsTurbo
Premium Member
Registered: 8th Jun 10
User status: Offline
|
i can do it on 1and1
|
Bart
Member
Registered: 19th Aug 02
Location: Midsomer Norton, Bristol Avon
User status: Offline
|
nothing to do with email, purely want to redirect traffic bart.mydomain.com to a directory on the website, www.mydomain.com/foldername
*edit* its deffo a CNAME yes?
The error I get is:
quote:
Sorry, there was a problem
Error: Only the characters . - a-z 0-9 are allowed in the right field
[Edited on 28-06-2012 by Bart]
|
VrsTurbo
Premium Member
Registered: 8th Jun 10
User status: Offline
|
when i create a subdomain in my control panel i can specify where it directs to.
|
VrsTurbo
Premium Member
Registered: 8th Jun 10
User status: Offline
|
cname wont go to folders thats direct to ip/names
|
Whittie
Member
Registered: 11th Aug 06
Location: North Wales Drives: BMW, Corsa & Fiat
User status: Offline
|
That way technically creates a sub "Public html", so copy all your contents from your main public html folder, that you're wanting to display, to the newly created one. You may need to change the name first to avoid confusion
[Edited on 28-06-2012 by Whittie]
|
Bart
Member
Registered: 19th Aug 02
Location: Midsomer Norton, Bristol Avon
User status: Offline
|
hmm.... i'll try subdomain rather than dns
|
VrsTurbo
Premium Member
Registered: 8th Jun 10
User status: Offline
|
Cname separates it via IP on DNS.
Say you have a domain but have different IP range internally.
Mail.xyz.com CNAME PUBLICIP
xyz.com A DIFFERENTPUBLICIP
The subdomain all gets done via the host
|
Bart
Member
Registered: 19th Aug 02
Location: Midsomer Norton, Bristol Avon
User status: Offline
|
ok thanks guys. Have setup a subdomain with a redirect to my address. I'll see how it goes
[Edited on 28-06-2012 by Bart]
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
quote: Originally posted by VrsTurbo
Cname separates it via IP on DNS.
Say you have a domain but have different IP range internally.
Mail.xyz.com CNAME PUBLICIP
xyz.com A DIFFERENTPUBLICIP
The subdomain all gets done via the host
CNAME is just an alias of an A record hostname. A records for IPs, CNAME's for hostnames.
If you wanted to point 'Mail.xyz.com' to another IP range then you'd set it up on a A record.
In Bart's case, the subdomain would be a CNAME of the domains A record ie:
code: mydomain.co.uk A (record) 1.1.1.1
bart.mydomain.co.uk CNAME mydomain.co.uk
(www.mydomain.co.uk would also be a CNAME of the domains primary A record)
What ever webserver Bart's using would handle the physical redirect to another directory.
Bart - if you're using cPanel (/DirectAdmin etc etc) and it's handling the DNS, then just set up a subdomain and point it to the required directory. It'll sort out the rest.
|
Bart
Member
Registered: 19th Aug 02
Location: Midsomer Norton, Bristol Avon
User status: Offline
|
Dom,
Yes im using a cpanel, but only for the hosting, everything is handled by another party.
(i decided to move web hosting only as a test, actually like it and decided not to mess about with mail or other dns etc).
Ive spoken with the hosting company and been told It needs to be a dns entry on the main hosts who manage dns settings.
So any idea what settings to input?
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
You wouldn't do this entirely with DNS would you? You'd use the following DNS settings:
A - * - 1.2.3.4
A - @ - 1.2.3.4
CNAME - www - @
That gives you the ability to wildcard subdomains and I guess the www CNAME isn't actually needed thinking about it. Alternatively you could get rid of the * A record and then declare all of your subdomains as CNAME's.
Your web server then handles the request, in Apache you'd need to edit your vhost.conf file to have something like this:
<VirtualHost *:80>
DocumentRoot /var/www/mydomain.co.uk/bart/
ServerName bart.mydomain.co.uk
</VirtualHost>
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
What Ed said
But as mentioned the DNS just points the domain to the server, the webserver handles the physical redirect (as you can see in Ed's Apache config example).
If your DNS is third-party then setup a CNAME with your domain as the hostname or set it up as an A record and point it to the IP of your server. Then under cPanel set up the subdomain (This Menu) with the document root being the directory you wanted it to redirect to.
cPanel will then handle configuring Apache.
[Edited on 29-06-2012 by Dom]
|