Welcome to WebmasterWorld Guest from 54.197.94.141

Message Too Old, No Replies

index.php and home.php... both indexed and receiving traffic

   
2:01 pm on Jun 18, 2009 (gmt 0)

10+ Year Member



I've just begun to work on a site that has the index.php and home.php both indexed and both receiving traffic.

- There is no default page set in Google Analytics
- Home.php receives 15.36% of the traffic
- / receives 13.76% of the traffice
- Index.php receives a small amount of traffic

I could presume / is home.php, but I'm not 100% sure. If I decide to set the default page as home.php is a 301 redirect from index.php to home.php the way to go?

Thanks in advance.

7:07 pm on Jun 18, 2009 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Yes, a 301 is the best. However, the fullest best practice is to use either www.example.com or just example.com as the canonical url - without any page name at all. I appreciate that with some servers this isn't practical without a lot of reconfiguration, but if you can take this approach, I'd say do it.

Also, I assumed that you were talking about Google traffic with those percentages - am I correct?

7:09 pm on Jun 18, 2009 (gmt 0)



The best solution is in two steps:

- Make it a policy never to link to an directory index document (e.g. index.htm, default.asp and so on). Always link to the full host name (http://www.example.com/) or the root of the directory (http://www.example.com/directory/)

- Permanently redirect (i.e. with an HTTP 301 status code) any requests for duplicate URLs to a single destination - in this case redirect /home.php and/or /index.php to /

The second is slightly more difficult to achieve technically, but if you're on Apache, you'll find a number of references to htaccess-based fixes courtesy of the apache forum [webmasterworld.com], e.g. removing index.php from 301 redirect [webmasterworld.com].

The easy way to check is to visit all of the URLs directly, and compare the content. Otherwise, you most likely have a list of default directory indexes specified in an htaccess file or set by your web hosting company.

8:09 pm on Jun 18, 2009 (gmt 0)

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



I would recommend doing the redirects on the server as suggested, and not setting a preference in Google Webmaster Tools at all, as that may only mask your problems.

The site could well have external inbounds to a large combination of urls... to "/", to "/home.php" and to "/index.php"... with or without the www. It's best to use proper redirects to get the links redirected and the urls all canonicalized.

I don't know that we're sure that Webmaster Tools is going to assign proper linking credit to all the variants. A proper redirect will.

There's further discussion of canonical issues in this thread, which you can find in the Duplicate Content section of Hot Topics, always pinned to the top of this forum's home page....

Canonical URL Issues [webmasterworld.com] - many ways to introduce duplicates

8:36 am on Jun 20, 2009 (gmt 0)

10+ Year Member



There are no cononical url issues as http://example.com is redirect to http://www.example.com. The issue is with:

- www.example.com/index.php
- www.example.com/home.php

Thanks for the suggestions and help everybody.

[edited by: Robert_Charlton at 9:42 pm (utc) on June 20, 2009]
[edit reason] changed to example.com - it can never be owned [/edit]

8:18 pm on Jun 20, 2009 (gmt 0)

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



Find out which *file* is being served when you request the URL "/".

Change all links that currently point to that filename to instead point to "/".

Redirect requests for that filename in the URL to instead request "/".

.

Is the "other" filename serving the same content as the above?

If so, then redirect requests for that filename to "/" too.

If it serves different content, then leave that one alone.

1:04 pm on Jun 21, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Just to be clear, this *is* a URL canonicalization issue. The domain canonicalization has evidently been taken care of, but you've apparently got three URLs for the same page, and therefore, at least two of those URLs are non-canonical.

Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month