jcw20
asked on
apache server with non www vs.www problem
ok i have website but when some types http://www.jdcamp.org vs. http://jdcamp.org one wikk work but the other will not Help how do i fix this
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
jcw20 - I had answered this in your original question.
You can use a ServerAlias as mentioned, or you can set up a second virtual server entry for the www.jdcamp.org version.
I should mention that while ServerAlias is the built in function in Apache to do this, search engines often penalize you for having multiple domains or subdomains pointing to the same site, because of the abuse of this concept. Same goes for having mulitple domains subdomains that simply point to the same site.
Therefore, for search engine optimization purposes, it makes more sense to set up a second entry, and do a permanent redirect like this:
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName www.jdcamp.org
(... )
</VirtualHost>
<VirtualHost site.com:80>
ServerName jdcamp.org
Redirect Permanent / http://www.jdcamp.org
</VirtualHost>
You can use a ServerAlias as mentioned, or you can set up a second virtual server entry for the www.jdcamp.org version.
I should mention that while ServerAlias is the built in function in Apache to do this, search engines often penalize you for having multiple domains or subdomains pointing to the same site, because of the abuse of this concept. Same goes for having mulitple domains subdomains that simply point to the same site.
Therefore, for search engine optimization purposes, it makes more sense to set up a second entry, and do a permanent redirect like this:
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerName www.jdcamp.org
(... )
</VirtualHost>
<VirtualHost site.com:80>
ServerName jdcamp.org
Redirect Permanent / http://www.jdcamp.org
</VirtualHost>
Ravenpl - good catch - I forgot the trailing slash. It should be:
<VirtualHost site.com:80>
ServerName jdcamp.org
Redirect Permanent / http://www.jdcamp.org/
</VirtualHost>
(works on my server).
<VirtualHost site.com:80>
ServerName jdcamp.org
Redirect Permanent / http://www.jdcamp.org/
</VirtualHost>
(works on my server).
You need to setup jdcamp.org up as a virtual server also.