I need to stop users accessing robots.txt file in my website. I am not sure if i add robots.txt to 301 redirection in htaccess, google may discard the robots.txt, so Please advise me about this.
Asked
Active
Viewed 389 times
-2
-
1**Why** on earth do you want to do that? If you're trying to hide URLs, that's the wrong way to do it. – SLaks Sep 14 '11 at 15:35
-
Maybe he's got some libelous comments about Yahoo! bot?! [stack overflow's](http://stackoverflow.com/robots.txt) – Widor Sep 14 '11 at 15:39
1 Answers
0
You can't stop users accessing your robots.txt directly. you can use htaccess to block users having specific region or browser version etc..

nidhin
- 6,661
- 6
- 32
- 50
-
I am not expert in htaccess coding, please guide me in this, is below code make sense. RewriteEngine On RewriteCond %{http_user_agent} !(googlebot|Msnbot|Slurp) [NC] RewriteRule ^robots\.txt$ http://seo.i-connector.com/ [R,NE,L] AddHandler application/x-httpd-php .txt Thanks and regards Krishna – user944963 Sep 14 '11 at 15:50