Search Engine Watch
SEO News

Go Back   Search Engine Watch Forums > Search Engine Marketing Strategies > Search Engine Optimization > Dynamic Website and Technical Issues
FAQ Members List Calendar Forum Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
Old 11-21-2011   #1
Jazajay
 
Jazajay's Avatar
 
Join Date: Jul 2007
Location: Leicester, England
Posts: 713
Jazajay has disabled reputation
Weird www.www. url problem and fix for this

Hi Peeps,
Right the other month I noticed a serious problem with our company's website and that was all URL's where indexable under www. and www.www. versions regardless of the 301 redirects that should have redirected them all to the www. version.

Don't ask me how.
Anyhoo I tracked it down to a problem with the host company's server configuration on a certain server type, forgive me for not mentioning which server due to how bad this could be for a lot of websites if it got out.

Now you can't remove these URLs via webmaster tools as it apprends the www.sitename for you, however if you encounter this and want a solution to solve it it can be fixed via server code that I came up with to deal with this problem.

This solution is in PHP, I imagine there is a ASP, whatever solution, I just don't know ASP, or whatever well enough to give it.

What you need to do is test the Server name to see which version it equals then apply the noindex, follow meta to the incorrect version.

So in the head tag stick this in but change example to your site name and the correct prefix as well.

<?php if("www.www.example.co.uk"==$_SERVER['SERVER_NAME']){?>
<meta name="robots" content="noindex, follow" />
<?php }?>

Jobs a goodun.

Now couple of tests that are important to make sure you have done it correctly.

Before you make this adjustment view the source code and take note of any metas in there.

Once the change has been made check the www.www version to make sure the noindex, follow meta is present, and check the www.version to make sure it is NOT present on that version and jobs a goodun, bad server configuration has now been patched and the search engines will eventually drop those pages, I found rather quicker than if you just relie on the Search engines to drop other noindex, follow pages out of the results.

Hope it helps someone other than myself.

Jay

Last edited by Jazajay : 11-28-2011 at 09:53 AM.
Jazajay is offline   Reply With Quote
Old 11-28-2011   #2
AussieWebmaster
Forums Editor, SearchEngineWatch
 
AussieWebmaster's Avatar
 
Join Date: Jun 2004
Location: NYC
Posts: 8,154
AussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant future
Re: Weird www.www. url problem and fix for this

great help mate am sure people will take this and thank you for sharing
__________________
Bruce Gillmer - MTV EMA
AussieWebmaster is offline   Reply With Quote
Old 11-28-2011   #3
Jazajay
 
Jazajay's Avatar
 
Join Date: Jul 2007
Location: Leicester, England
Posts: 713
Jazajay has disabled reputation
Re: Weird www.www. url problem and fix for this

No worries,
If we're having that problem I imagine some other peeps are as well and it was kind of one of those moments where you go and I fix this how now?

So thought I would share how we did.
Jazajay is offline   Reply With Quote
Old 12-02-2011   #4
AussieWebmaster
Forums Editor, SearchEngineWatch
 
AussieWebmaster's Avatar
 
Join Date: Jun 2004
Location: NYC
Posts: 8,154
AussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant future
Re: Weird www.www. url problem and fix for this

the www non www is always a problem with new clients... with a ton also with index.html and default.aspx etc use in home page link
__________________
Bruce Gillmer - MTV EMA
AussieWebmaster is offline   Reply With Quote
Old 12-02-2011   #5
Jazajay
 
Jazajay's Avatar
 
Join Date: Jul 2007
Location: Leicester, England
Posts: 713
Jazajay has disabled reputation
Re: Weird www.www. url problem and fix for this

Hi Aussie,
O no this was a far, far worse problem than just the normal www. and none www. issue. It was so bad that in theory you could create over a million, well the actually number is impossible to calculate as it would all be down to how much the server could cope with before it would choke, versions of the same site and have them all indexed, well until the Search Engines gave up indexing due to the sheer volume of duplicated sites.

I have worked out how it was possible now and a full fix to it, but don't want to give that out as that will give the reason as to why it was happening in the first place and thus how to create it and which will make it a easy attack to check for, so won't be sharing the full fix for obvious reasons. But to fix it for any one else who does experiance this, rewrite the above script to:

<?php if("www.example.co.uk"!==$_SERVER['SERVER_NAME']){?>
<meta name="robots" content="noindex, follow" />
<?php }?>

And the site will be fully protected. Not the full solution but a good as work around with out giving too much away.

Note: Above checks still need to be preformed to make sure you just haven't blocked your entire site.

Nice guy Jaz
Jazajay is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off