1

I have a website on a subdomain, and would like to hide the fact that it's a sub-domain. How can I do so?

For example, the site is www.example.com, and it's a sub-domain of www.mydomain.com. I don't want people to know that example.mydomain.com is the same as www.example.com. How do I hide this? With .htaccess? How?

Thanks!!

luqita
  • 4,008
  • 13
  • 60
  • 93

2 Answers2

0

www.example.com is impossible to be a sub-domain of www.mydomain.com. I think you mean they point to the same IP address and, therefore, they point to the same website (or there are some kind of redirect).

A domain is simply, example.com or mydomain.com. Examples of sub-domains of these domains are: www.example.com, mobile.example.com, whatever.mydomain.com and they could, or not, point to the domain root.

I'll present you an example:

Google App Engine let's you chose a appspot.com subdomain, for instance, myapp.appspot.com. If you call this subdomain you access your website. But people usually want to use their own domain, or a subdomain, for instance, myapp.mydomain.com. Both subdomains will return the same content. If you'd wish to disable the appspot.com subdomain, you may follow this solution.

Community
  • 1
  • 1
nunaxe
  • 1,432
  • 2
  • 15
  • 16
0

You could use the 'proxy|P' (force proxy) flag. Read the manual http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

Note: mod_proxy must be enabled in order to use this flag.

akond
  • 15,865
  • 4
  • 35
  • 55