Use DNS subdomain to point to specific webpage

hardwyre
hardwyre used Ask the Experts™
on
I would like to use a sub-domain to point directly to a page inside a site.  I have used CNAMES to point to another site entirely but can they be used to point to a PAGE inside a site.  If a CNAME is not the right way, what is.  I know I can configure APACHE to listen for careers.site.com and use an HTML redirect page.  But I was looking for a more direct method using DNS.

Example: careers.site.com  = www.site.com\contact\apply\career.htm

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
You could create a virtual site "careers.site.com" which points to a subdir containing an index.html file (your career.html file).
Otherwise, you would need to look at some regex pattern matching re-write rules.

Commented:
The DNS entry direct traffic to the right IP address.
It is then the job of the web server (IApache or whatever) on that IP to direct that traffic to the right site.
Chris DentPowerShell Developer
Top Expert 2010

Commented:

The guys are correct. You need a web server to handle the redirection, DNS is out once you have the name to an IP, it can't take you to a specific page.

Chris
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Author

Commented:
So in Apache is there a setting (like host headers in IIS) that can catch the incoming request careers.site.com and automatically redirect to a sub page in an existing site?
Most Valuable Expert 2015

Commented:
Use Virtualhost containers.

Configure site.domain.com to point to the IP on the server (it can be the same IP used for other hosts).

Inside your virtualhost container, you identify the virtualhost name and can specify the default page to load.

Or use the rewrite module to rewrite that site.domain.com to site.domain.com/whatever.html.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial