Forum Moderators: phranque

Message Too Old, No Replies

www in vhosts

vhost www

         

dringof1

4:10 pm on Apr 19, 2008 (gmt 0)

10+ Year Member



Guys,

This is my first 24hrs in Apache and so far so good. This is probably quite a basic question so bare with me.

I have added all of my domains to Apache and all is good. It works well when I type www.domain.com but when I type [domain.com...] or just domain.com it shows the contents of my root folder.

How can I make it show the correct directory? and is this a security risk?

Thanks alot.

jdMorgan

4:54 pm on Apr 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See the ServerAlias directive.

Also, to prevent duplicate-content issues and PageRank/Link-populairty dilution, be sure to redirect all requests for the non-canonical domain to the canonical domain. That is, pick "www" or "non-www" as your canonical domain, and 301-redirect the other one.

Jim

g1smd

7:58 pm on Apr 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You're usually better off to use www.domain.com because you can then search site:domain.com -inurl:www to find any wrongly indexed non-canonical URLs.

dringof1

6:24 pm on Apr 20, 2008 (gmt 0)

10+ Year Member



Guys. Thanks alot for your replies. The alias is working well but to stop duplicate content I think I will just use my robots.txt to stop the search engines from indexing the same stuff. Is this an acceptable option? Cheers.

jdMorgan

7:13 pm on Apr 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The recommended 301-redirect is a better option, since it preserves any PageRank or Link-popularity assigned to the non-canonical domain(s).

Jim