[users@httpd] Canonicalizing Domains / Hostnames
Hi All, I have a site that is accessible through multiple hostnames like: http://www.busicorp.com/ http://server123.vps.hosting.net/ http://busicorp.com/ but I only want the site to be accessible through the first hostname (http://www.busicorp.com/ and https://www.busicorp.com/). How can I block these other hostnames? I have been using Apache for many years but I'm drawing a blank as to where to begin with this. Can someone give me a pointer? Thanks, Mike - The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] Canonicalizing Domains / Hostnames
It was thus said that the Great Michael B Allen once stated: Hi All, I have a site that is accessible through multiple hostnames like: http://www.busicorp.com/ http://server123.vps.hosting.net/ http://busicorp.com/ but I only want the site to be accessible through the first hostname (http://www.busicorp.com/ and https://www.busicorp.com/). How can I block these other hostnames? I have been using Apache for many years but I'm drawing a blank as to where to begin with this. Can someone give me a pointer? The easiest might be to set the non-preferred domains to redirect to the preferred domain. Something like: VirtualHost 205.186.183.199:80 ServerNameserver123.vps.hosting.net busicorp.com Redirect permanent / http://www.busicorp.com/ /VirtualHost That will redirect all requests to server123.vps.hosting.net and busicorp.com to your preferred domain name, and at least as far as Google goes, the Page Rank for the non-preferred sites will be transferred to the preferred domain name. -spc - The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] Canonicalizing Domains / Hostnames
On Wed, Jul 6, 2011 at 8:59 PM, Sean Conner s...@conman.org wrote: It was thus said that the Great Michael B Allen once stated: Hi All, I have a site that is accessible through multiple hostnames like: http://www.busicorp.com/ http://server123.vps.hosting.net/ http://busicorp.com/ but I only want the site to be accessible through the first hostname (http://www.busicorp.com/ and https://www.busicorp.com/). How can I block these other hostnames? I have been using Apache for many years but I'm drawing a blank as to where to begin with this. Can someone give me a pointer? The easiest might be to set the non-preferred domains to redirect to the preferred domain. Something like: VirtualHost 205.186.183.199:80 ServerName server123.vps.hosting.net busicorp.com Redirect permanent / http://www.busicorp.com/ /VirtualHost That will redirect all requests to server123.vps.hosting.net and busicorp.com to your preferred domain name, and at least as far as Google goes, the Page Rank for the non-preferred sites will be transferred to the preferred domain name. Hi Sean, Ok. But I already have: VirtualHost *:80 ServerName www.busicorp.com ... /VirtualHost Can I have multiple VirtualHost sections with the same address (*:80) or expressions that overlap logically? Mike - The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] Canonicalizing Domains / Hostnames
It was thus said that the Great Michael B Allen once stated: Hi Sean, Ok. But I already have: VirtualHost *:80 ServerName www.busicorp.com ... /VirtualHost Can I have multiple VirtualHost sections with the same address (*:80) or expressions that overlap logically? Yes. You'll need to add a NameVirtualHost directive before the VirtualHost directives. NameVirtualHost *:80 VirtualHost *:80 ServerName www.busicorp.com ... /VirtualHost VirtualHost *:80 ServerName server123.vps.hosting.net busicorp.com Redirect permanent/ http://www.busicorp.com/ /VirtualHost The NameVirtualHost directive tells Apache that there multiple sites sharing the same IP address. Apache will then use the information the browser passes in (as part of the request) to determine which site to reference (it's the Host: header the browser sends in). If it's missing, Apache will default to the first VirtualHost listed (so you want your primary listed first---unless I'm mistaken, which I could be). -spc - The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] Canonicalizing Domains / Hostnames
On Wed, Jul 6, 2011 at 10:05 PM, Sean Conner s...@conman.org wrote: It was thus said that the Great Michael B Allen once stated: Hi Sean, Ok. But I already have: VirtualHost *:80 ServerName www.busicorp.com ... /VirtualHost Can I have multiple VirtualHost sections with the same address (*:80) or expressions that overlap logically? Yes. You'll need to add a NameVirtualHost directive before the VirtualHost directives. NameVirtualHost *:80 VirtualHost *:80 ServerName www.busicorp.com ... /VirtualHost VirtualHost *:80 ServerName server123.vps.hosting.net busicorp.com Redirect permanent / http://www.busicorp.com/ /VirtualHost The NameVirtualHost directive tells Apache that there multiple sites sharing the same IP address. Apache will then use the information the browser passes in (as part of the request) to determine which site to reference (it's the Host: header the browser sends in). If it's missing, Apache will default to the first VirtualHost listed (so you want your primary listed first---unless I'm mistaken, which I could be). Thanks, This worked for redirecting busicorp.com to http://www.busicorp.com/. But it did not work for server123.vps.hosting.net (which strangely enough has a different IP address). Odd. Mike - The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] Canonicalizing Domains / Hostnames
On Wed, Jul 6, 2011 at 10:23 PM, Michael B Allen iop...@gmail.com wrote: On Wed, Jul 6, 2011 at 10:05 PM, Sean Conner s...@conman.org wrote: It was thus said that the Great Michael B Allen once stated: Hi Sean, Ok. But I already have: VirtualHost *:80 ServerName www.busicorp.com ... /VirtualHost Can I have multiple VirtualHost sections with the same address (*:80) or expressions that overlap logically? Yes. You'll need to add a NameVirtualHost directive before the VirtualHost directives. NameVirtualHost *:80 VirtualHost *:80 ServerName www.busicorp.com ... /VirtualHost VirtualHost *:80 ServerName server123.vps.hosting.net busicorp.com Redirect permanent / http://www.busicorp.com/ /VirtualHost The NameVirtualHost directive tells Apache that there multiple sites sharing the same IP address. Apache will then use the information the browser passes in (as part of the request) to determine which site to reference (it's the Host: header the browser sends in). If it's missing, Apache will default to the first VirtualHost listed (so you want your primary listed first---unless I'm mistaken, which I could be). Thanks, This worked for redirecting busicorp.com to http://www.busicorp.com/. But it did not work for server123.vps.hosting.net (which strangely enough has a different IP address). Odd. Nevermind. I have my servers mixed up. I had to tweak the config on two separate servers. I have it all working now (I think). Thanks, Mike - The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org