Masking a Subdomain


I need to know how to mask a domain either through .htaccess or through code. I have a website under the subdomain which is working fine. Now I have another domain name and I want this to mask my the subdomain URL.So if a user goes to, they will see the site, but the address-bar will still show I know I could use a iFrame, but the client wants to to show the same content as

I know many of you may respond about the SEO problems this creates, but the client plans to advertise the only in print. So hopefully this domain name will never show up in the search engines. People will always see the site as in Google unless they manually type in into the address bar from a magazine.

I already have the two virtual accounts set up on the server.


Any help is greatly appreciated.

Sounds like the perfect job for ServerAlias.


There are safeguards to protect against what you’re describing - hijacking of another webmaster’s website. Just remember that, when you change domains (and every subdomain is a separate domain), browsers WILL display the new domain to protect the copyright of the displayed domain. Frames can be made to work as well as AJAXing content which is pulled from subdomain but that’s not the wise way to go.

IMHO, the best solution for you would be to PARK newdomain on the directory of the - assuming that you own/control/host both domains.

Yes, ServerAlias may work but ONLY if you have control over the server and/or virtual host file (which most webmasters will never have … until you get to dedi and, maybe, VPS).



in shared hosting directory created

if you want to create it on your desire location then it can be don in vps or dedicated server