0

I am trying to find answer for this for a long time.
I have created one site and i handle the not found page(404 pages) through .htaccess. Everything works great but when i submitted to google webmaster for indexing (in fetch as google) it showing an error ( status = not found).
Does anyone know How to tell google to handle these pages (index these pages)

my .htaccess file is

ERRORDOCUMENT 404 /redirect.php

in my redirect.php file i take the necessary action. like if URL is www.mysite.com/username then profile of that user is shown

Thank in advance

ashishmaurya
  • 1,196
  • 10
  • 18

1 Answers1

2

Google will never index 404 error pages.

You can use .htaccess with:

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /redirect.php [L]

which redirected all links to pages that do not exist

if you use:

RewriteRule ^ /redirect.php [R=301,L]

the link change in the browser. But with [L] you can show your page without link change.

Croises
  • 18,570
  • 4
  • 30
  • 47