views:

24

answers:

1

Using a redirect statement in my htaccess file, people who type the following into the address bar...

http://example.com/index.php

...are redirected to...

http://example.com/

I also have a noindex, nofollow meta tag on all my website's pages.

My question is, given that redirect behavior and meta data, will googlebot index my mainpage (i.e. index.php) if my robots.txt file is as follows...

User-agent: Googlebot
Allow: /index.php
Disallow: /

User-agent: *
Disallow: /

If not, how should I change my robots.txt so that only my mainpage will be indexed in google and nothing more?

Thanks in advance!

A: 

It's risky. To be sure that Google does index your homepage make this:

User-agent: *
Allow: /index.php
Disallow: /a
Disallow: /b
...
Disallow: /z
Disallow: /0
...
Disallow: /9

So your root "/" will not match disallow rules.

Also if you have AdSense don't forget to add

User-agent: Mediapartners-Google
Allow: /
how
It's not necessary to add all those Disallow lines. A simple `Disallow: /` will work. Google's online examples clearly show that `Allow` is processed before `Disallow`, despite what the robots.txt "standard" says.
Jim Mischel