tags:

views:

182

answers:

0

I've searched here through many posts for this but can't seem to find a solution that works for me. I'm sure this is due to my lack of knowledge when it comes to .htaccess.

Here is the problem. A client printed marketing materials with subdomain vanity urls (i.e., www.newproduct1.client.com) for the purpose of tracking via Google analytics. There is no actual need for a subdomain because the link should just redirect to a page on the main site. I have several vanity subdomains I need to address (i.e. www.newproduct1.client.com, www.newproduct2.client.com, etc.) and I need it to work with and without 'www' ('www.subdomain.client.com' and 'subdomain.client.com').

I tried actually setting up the subdomains but one of the problems is the client used the 'www' in the link, which doesn't work on MediaTemple DV servers without altering the server setup.

I would like to avoid altering the server as the above link suggests for a couple of reasons. One I am not that comfortable doing it and two it seems like overkill for this particular need.

So in summary, I don't actually need the subdomain I just need a 'www.subdomain.client.com' request to automatically redirect (with and without 'www') to a page/directory on main domain (different for each fake subdomain). Is that possible with .htaccess?

It is a MediaTemple DV 3.5 server using CentOS 5 (sorry, I would link to it but I am limited to one hyperlink in a post apparently).

Thanks in advance for any help. John