Solved

apache server with non www vs.www problem

Posted on 2006-06-21
5
214 Views
Last Modified: 2010-03-04
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
0
Comment
Question by:jcw20
  • 2
  • 2
5 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 16956708
O.K.  Looks like you are using Apache and you have www.jdcamp.org setup as a virtual server, but you do not have jdcamp.org setup as a virtrual server so it is getting the default Apache web page.

You need to setup jdcamp.org up as a virtual server also.
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 300 total points
ID: 16958763
Or make an alias within VirtualHost, eg.

ServerName www.jdcamp.org
ServerAlias jdcamp.org
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16959029
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>


0
 
LVL 43

Expert Comment

by:ravenpl
ID: 16959053
periwinkle: it has one drawback, what if somebody would want visit
http://jdcamp.org/subpage/
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16959144
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).
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question