homepage Welcome to WebmasterWorld Guest from 54.161.200.144
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Google / Google SEO News and Discussion
Forum Library, Charter, Moderators: Robert Charlton & aakk9999 & brotherhood of lan & goodroi

Google SEO News and Discussion Forum

    
Redirecting example.com/index.php to example.com
Google thinks they are separate pages
darkroom




msg:3082364
 3:03 am on Sep 14, 2006 (gmt 0)

It seems that google treats www.wexample.com and www.example.com/index.php as two separate entities. One has PR5 and the other has PR4. Does anybody know how can i effectively redirect index.php to the root(www.example.com)?

[edited by: tedster at 4:14 am (utc) on Sep. 14, 2006]
[edit reason] use example.com [/edit]

 

tedster




msg:3082414
 4:30 am on Sep 14, 2006 (gmt 0)

You're correct that these are two different URLs and if both are indexed in Google you can get "split PR".

Assuming you are on an Apache server, here's a thread with a Rewrite solution [webmasterworld.com] from jdMorgan that you can use in your .htaccess file:

# mod_rewrite setup
Options +FollowSymLinks
RewriteEngine on
#
# Redirect direct client /index.html requests to "/" (does not affect DirectoryIndex accesses)
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html
RewriteRule ^index\.html$ http://example.com/ [R=301,L]

FireBrigade




msg:3084384
 3:15 pm on Sep 15, 2006 (gmt 0)

Tedster,

Is this also a possibility on IIS? I have a site where both http://www.example.com/default.aspx and http://www.example.com/ are listed.
The problem is that IIS adds the default.aspx automatically as the defaukt document, otherwise it does not know where the results from http://www.example.com/ are supposed to come from.
I cannot find any difference in the request header or content between the requests for both pages.

Alex70




msg:3084538
 4:41 pm on Sep 15, 2006 (gmt 0)

It looks is working fine to me in this way:

<?php
if(strstr($_SERVER["REQUEST_URI"],"index.php"))
{
header( "HTTP/1.1 301 Moved Permanently" );
header( "Status: 301 Moved Permanently" );
header("location:./");
exit();

g1smd




msg:3085746
 7:23 pm on Sep 16, 2006 (gmt 0)

For IIS it is even worse, you have yet more duplicates at /Default.asp and /default.ASP and many others, etc.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Google / Google SEO News and Discussion
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved