Forum SEO Search Engine Optimization Makes Your Forums Irresistable To Spiders! Techniques and Tips For vBulletin SEO, IPB SEO, and phpBB SEO. Increase Your Forum's Search Engine Rankings.

Reply
 
Thread Tools

  #1  
Old 04-10-2012, 09:54 PM
Demon's Avatar
Demon Demon is offline
TAZ Rookie
 
Join Date: Aug 2007
Admin Experience: Advanced
Posts: 28
Demon has a spectacular aura about
Default Googled indexed some www.www links
Due to an error in my .htaccess, Google has indexed some of my links as www.www.domain.com instead of the regular www.domain.com

I've made a php script, which 301-redirects every request without www.domain.com as "http_host" to www.domain.com while adding the "request_uri" after it.

PHP Code:
www.www.domain.com/forum/member-1.php --> www.domain.com/forum/member-1.php 
Google Webmaster Center doesn't support the removal of links in that way.
Is this sufficient for Google to get rid of the false links in due time?
Reply With Quote
  #2  
Old 04-13-2012, 08:39 AM
googleguru's Avatar
googleguru googleguru is offline
Tazmanian
 
Real Name: Kushal Biswas
Join Date: May 2009
Admin Experience: Intermediate
Location: India
Posts: 222
googleguru is just really nicegoogleguru is just really nice
Default
can you post the code of that php file and the code in your .htaccess ?

I think you have made a mess in that two files
__________________
SEO Blog - Highly researched SEO, PPC, SMO articles.

Tech Blog- Interesting technology oriented articles
Reply With Quote
  #3  
Old 04-13-2012, 01:59 PM
Demon's Avatar
Demon Demon is offline
TAZ Rookie
 
Join Date: Aug 2007
Admin Experience: Advanced
Posts: 28
Demon has a spectacular aura about
Default
The code in the .htaccess (http:// to http://www redirection) has been removed and replaced by the following PHP script, which does both the desired http://www redirection and correction of existing www.www links

Code:
if (strpos($_SERVER['HTTP_HOST'], 'www.MYDOMAIN.com') !== 0) {
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: http://www.MYDOMAIN.com' . $_SERVER['REQUEST_URI']);
    exit();
}
Reply With Quote
  #4  
Old 04-18-2012, 01:56 AM
googleguru's Avatar
googleguru googleguru is offline
Tazmanian
 
Real Name: Kushal Biswas
Join Date: May 2009
Admin Experience: Intermediate
Location: India
Posts: 222
googleguru is just really nicegoogleguru is just really nice
Default
Code:
if (strpos($_SERVER['HTTP_HOST'], 'www.MYDOMAIN.com') !== 0) {
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: http://www.MYDOMAIN.com' . $_SERVER['REQUEST_URI']);
    exit();
}
I cant find anything wrong in this code .Perhaps you can try with this

Code:
if (strpos($_SERVER['HTTP_HOST'], 'MYDOMAIN.com') !== 0) {
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: http://www.MYDOMAIN.com' . $_SERVER['REQUEST_URI']);
    exit();
}
__________________
SEO Blog - Highly researched SEO, PPC, SMO articles.

Tech Blog- Interesting technology oriented articles
Reply With Quote
  #5  
Old 04-18-2012, 03:16 PM
Demon's Avatar
Demon Demon is offline
TAZ Rookie
 
Join Date: Aug 2007
Admin Experience: Advanced
Posts: 28
Demon has a spectacular aura about
Default
Quote:
Originally Posted by Demon View Post
The code in the .htaccess (http:// to http://www redirection) has been removed and replaced by the following PHP script, which does both the desired http://www redirection and correction of existing www.www links

Code:
if (strpos($_SERVER['HTTP_HOST'], 'www.MYDOMAIN.com') !== 0) {
    header('HTTP/1.1 301 Moved Permanently');
    header('Location: http://www.MYDOMAIN.com' . $_SERVER['REQUEST_URI']);
    exit();
}
I believe I did lose some false Google results with this code =D
Not all, but it seems to work

Strpos seems to be overkill btw

Last edited by Demon; 04-18-2012 at 03:32 PM..
Reply With Quote
Reply

  Admin Zone Forums > The Community Zone > Finance and Traffic > Forum SEO





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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
indexed pages DCortez Forum SEO 8 05-08-2010 08:08 AM
Getting re-indexed after being down for 3 weeks cpvr Forum SEO 13 07-21-2009 04:43 PM
how useful are links from indexed pages? 64North Increasing Traffic 1 06-06-2006 08:07 AM
google indexed links gone after downtime JB1989 Forum SEO 6 01-07-2006 07:04 AM
How many: Indexed pages / links does google report? rex_b Forum SEO 39 02-16-2005 05:30 AM


 

All times are GMT -4. The time now is 11:37 AM.


Powered by: vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Page generated in 0.06115198 seconds with 15 queries
The Admin Zone copyright 2003-2014 All Rights Reserved. Content published on The Admin Zone requires permission for reprint.