Welcome to WebmasterWorld Guest from 54.234.153.197

Forum Moderators: bakedjake

Message Too Old, No Replies

users entering www

     
10:25 am on Aug 2, 2014 (gmt 0)

New User

5+ Year Member

joined:Feb 25, 2011
posts: 5
votes: 0


Hi,

I have a client on my server which is running unbuntu.

The problem is that when a user enters wwww before a url they are shown the homepage of the first domain in the domains folder, for example if I have many domains in the domains folder on the server with the top domain being 123.com.

When a user enters wwww.xyz.com they are actually served with the homepage of 123.com, which isn't good but we have also discovered it meses up the se spider as well and there is all kinds of weird indexing going on.

Has anyone else come across this?

Anyway I am trying to figure out a fix for this so that when someone enters wwww or ww or w before xyz.com they are directed to www.123.com.

I have tried setting A records for each prefix but that didn't work and I am not having much luck with .htaccess either.

Any words of wisdom or examples would be greatly appreciated

Thanks

Dave
10:43 am on Aug 2, 2014 (gmt 0)

Full Member

5+ Year Member

joined:Nov 4, 2006
posts: 292
votes: 0


HI
I had that once on my web server, it was in fact the virtual hosts were not declared properly I added * in the DNS declaration (*.mysite.com)
when i typed in mysite.com instead of www.mysite.com it brought me to the first site on the server (alphabetically)
Is this your case
For the rest I am not clear on what set up you have and some parts I do not understand.
11:19 am on Aug 2, 2014 (gmt 0)

New User

5+ Year Member

joined:Feb 25, 2011
posts: 5
votes: 0


Hi pp46,

yes I already have * A record for the domains and tried to set a records for wwww,ww and just w but that didn't work as the probeml was still there.

I think it might be some sort of server misconfig but am waiting for a reply from tech support.

Anyway thanks for your quick input it's much appreciated

Cheers

Dave
1:24 pm on Aug 2, 2014 (gmt 0)

Full Member

5+ Year Member

joined:Aug 16, 2010
posts:217
votes: 11


I think there are two problems..

1) The first virtual host is the default virtual host in apache. So if a hostname can not be mapped to a virtual host the first virtual host is used. Thats why i configure an empty first virtual host. I think if you type the IP of the server in your browser 123.com is displayed?

2) If every hostname like <whatever>.xyz.com returns an IP address there is a problem in the DNS of xyz.com. Remove * record. And wait till you get a fresh DNS answer NOT the cache.
1:51 pm on Aug 2, 2014 (gmt 0)

New User

5+ Year Member

joined:Feb 25, 2011
posts: 5
votes: 0


Hi bhukkel,

thanks for your reply, I think we have it sussed now, basically we have set up a dummy virtual server and "badurl.com" and then tied that to the to the servers Ip address, so now when we get someone using wwww,ww or w they see a page informing them that have entered a bad url, please check it and try again and it is working phew!

Thanks again

Dave
6:35 pm on Aug 2, 2014 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10550
votes: 10


welcome to WebmasterWorld, Dave!

you should read the Apache documentation on configuring name-based virtual hosts:
[httpd.apache.org...]
8:18 pm on Aug 2, 2014 (gmt 0)

Junior Member from IT 

joined:Oct 29, 2013
posts: 143
votes: 0


Hi ozbod,

That sounds like a good solution, but it asks the visitor to do some work in order to get to the right domain. For more immediate solutions, have you tried Apache's mod_alias to setup simple redirects from w., ww. or wwww.?

Docs are here: [httpd.apache.org...]
9:55 pm on Aug 2, 2014 (gmt 0)

New User

5+ Year Member

joined:Feb 25, 2011
posts: 5
votes: 0


Hi phranque and n0tSEO, thank you both for your input, looks like I need to do some learning so thank you for the references, I will look into them and discuss them with the server Sys Admin.

Have a good day Guys

Cheers

Dave
8:52 pm on Aug 3, 2014 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member dstiles is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:May 14, 2008
posts:3099
votes: 3


A warning: If you permit several subdomains (eg w, ww, www) then make sure they are 301'd to a single home site, otherwise search engines WILL gather them all and accuse you of spamming.
8:35 am on Aug 4, 2014 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10550
votes: 10


have you tried Apache's mod_alias to setup simple redirects from w., ww. or wwww.?

mod_alias will not allow you to examine the requested hostname, so you want to use mod_rewrite for this instead.
6:28 am on Aug 15, 2014 (gmt 0)

New User

5+ Year Member

joined:Feb 25, 2011
posts: 5
votes: 0


Hi All,

just wanted to let you now that we got to the bottom of this problem in the end, it was in the DNS settings, we deleted the * A record and all is good now, for example if we use wwww we now get a page not found page which is what it should be, yes the visitor is left at a bad page but the spiders can't go anywhere from here.

Thanks for your input everyone

Dave
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members