homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Google Redirect Error
google giving redirect error in indexing my pages

5+ Year Member

Msg#: 3930667 posted 6:51 pm on Jun 10, 2009 (gmt 0)


I have another problem about google that I have send my web to google and all of my pages are been indexed by google and all of these pages are at .php version

Now I just redirect all my .php pages to .html extension like
www.example.com/category/pagename.php (this page is google indexed) I want it to redirect to
www.example.com/category/pagename.html (I want this page to be indexed and old page to be left by google)

BUT the google is giving error like this
www.example.com/category/pagename.php Redirect Error

Please can anyone hmlp me out about this problem or just I have to send my .htaccess file to clear the view

Thanks in advance for helping me



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

Msg#: 3930667 posted 10:03 pm on Jun 10, 2009 (gmt 0)

The error message details are important. It is likely that the Google "error" explanation says that you are linking to a URL that redirects.

Do not use the redirects to 'fix' errors on your own site, use them only to fix search engine listings. If you want the page to be known as www.example.com/category/pagename.html, then you must make sure that all links on your site point to the URL www.example.com/category/pagename.html, and that you only use the redirect to speed up the 'correction' of the Google search listing of www.example.com/category/pagename.php and to recover the traffic from old bookmarks and from other web sites that link to the 'wrong' URL.

It is important that every link on your site goes to the correct and final URL, and not result in a redirect. Otherwise Google will complain, your log file and stats will be polluted with extra redirected requests, and users will suffer delays due to the extra HTTP transaction required to execute a redirect.



5+ Year Member

Msg#: 3930667 posted 6:01 am on Jun 11, 2009 (gmt 0)

Thanks for reply

But I read some where in the forums and in google guidelines (http://www.google.com/support/webmasters/bin/answer.py?answer=70897&hl=en#2) that do not make your pages dynamic else google will crawl them slowly as compare to static URLs, so I am trying to convert my all pages link to html but they are just having backhand through .php version like I use the below script to do this

#Giving all php pages html extension
RewriteRule ^(.*)\.html$ $1.php [L]

and I also change all of my webs links to .html version where it is set to .php

Now you are saying that all URLS goto correct and final URL now can you please explain me that what is the final URL in your mind the
www.example.com/category/pagename.php or

OR if final URL is php version so you as my sir I am asking you that is there any problem in indexing of pages ?

but I think google is indexing that .php version through my robots txt file so I redirect my .php pages to .html that when anyone opens .php version then redirected to .html and when open .html version then URL is displaying .html but backhand is .php so can google index that .php version from any where else from my internal web (not included external)?

Your point is valid that it will take more time to execute because its a redirect, I am agree with this point but please explain me the final URL destination want to be ?


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

Msg#: 3930667 posted 5:51 pm on Jun 11, 2009 (gmt 0)

Before you started this mod_rewrite project:
The final URL was www.example.com/category/pagename.php
The actual server filepath was <DocumentRoot>/category/pagename.php
All on-page links on your site were to www.example.com/category/pagename.php

After adding the RewriteRule shown in your previous post:
The final URL is www.example.com/category/pagename.html
The actual server filepath is <DocumentRoot>/category/pagename.php
All on-page links on your site must point to www.example.com/category/pagename.html

With mod_rewrite, the URL and the filepath are shown to be completely different things. They always are different things, but this is not so obvious until you use mod_rewrite or mod_alias.

The comment on your rewriterule posted above indicates that your understanding of what the rule does is not quite correct. Here is the complete code that you need (after correcting all on-page links on your site to point only to ".html" pages):

# Externally redirect all [i]direct client[/i] requests for .php URLs to .html URLs
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*[^.]+\.php(\?[^\ ]*)?\ HTTP/
RewriteRule ^(([^/]+/)*[^.]+)\.php$ http://www.example.com/$1.html [R=301,L]
# Internally rewrite all requests for .html page URLs to .php filepaths
RewriteRule ^(.+)\.html$ $1.php [L]

Note the terms "redirect", "rewrite", "URLs", and "filepaths" in the rule comments above. They are used intentionally and precisely.

Google is not at all likely to be "indexing the .php versions through your robots.txt file." They are more likely to be indexing them through old links on other Web sites, or through un-corrected old links on your own site. Google also "remembers" old URLs for many years, and will continue to ask for them occasionally... I believe that a recent post here on WebmasterWorld indicated that Google was asking for 11-year-old obsolete URLs from one of our member's sites!



5+ Year Member

Msg#: 3930667 posted 5:59 pm on Jun 11, 2009 (gmt 0)

ya sure as you mention above to redirect to .html pages when asked for .php page

I have placed this script in my .htaccess file now I am confirm about my problem and also the solution you gives me about the google memory

Again thanks for you help
Sorry for disturbing
I will disturb you again if got some problem
well have a nice day

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
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