2014-02-25 37 views
0

我有一個目錄有3種文件robots.txt能否阻止目錄中的一種文件類型?

1. thisdir/some/phpfile.php 

2. thisdir/some/after-url-rewrite/1 (all numbers) 

3. thisdir/something.htm (block any file end with .htm in thisdir/ 

我只是想阻止第三類型的文件,因爲不存在了,而是搜索引擎蜘蛛不斷地問他們

謝謝您的幫助。

回答

0

寫如果這個文件不存在,那麼你可以在第三文件的所有請求重定向只用301碼的有效鏈接。

RewriteEngine On 

RewriteRule ^thisdir/something\.htm$ /thisdir/some/phpfile.php? [L,NC,R=301] 
相關問題