I have a main hosting registered with the domain example.com. The hosting allows me to park another domain. I want that any person that access to example2.com be redirected to sub.example.com. In this way:

the user access to:               example2.com/something/a.html
The user sees the content of:     sub.example.com/something/a.html
And the browser displays:         example2.com/something/a.html

I tried to do a CNAME from example2.com to sub.example.com but the pages go to example.com. I think that is because the domain is parked at that hosting.

When I get that done, how I ensure that Google displays example2.com and not the other subdomain?

  • There's also a way with .htaccess, which I can't remember off the top of my head. – ashleedawg Jan 20 '19 at 14:14

You could look into doing a "frame redirect". It is also sometimes called "web forwarding" or "masked redirect". In that case the redirect server issues content like this:

<frameset rows="100%,*" border="0">
<frame src="http://www.example.com/my-page.html" noresize frameborder="0">

This causes the browser to show the contents of your main site, but the URL will show the redirect domain.

This type of redirect is not ideal:

  • The URL doesn't change as the user browses around the site
  • It breaks bookmarking functionality

The other option is to fully duplicate the content and fully host two different domains that have all the same pages on them.

  • Or with a webhosting with multidomain funcionalities. (: Thanks! – Hernan Di Giorgi Oct 12 '14 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.