.htaccess关闭搜索引擎整个网站,除了一些网址(kohana)

时间:2013-09-11 06:39:08

标签: php .htaccess indexing search-engine kohana

关于:
网站kohana,版本3.0.8。

问题:
我希望关闭搜索引擎整个网站,除了
baseinvest.kz/project及其内页(baseinvest.kz/project/view/110)

.htaccess文件

RewriteEngine On
RewriteBase /
<Files .*>
Order Deny,Allow
Deny From All
</Files>
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} !=/robots.txt
RewriteRule .* index.php [L]

1 个答案:

答案 0 :(得分:0)

我通过添加文件robots.txt

找到了解决方案
User-agent: *
Disallow: /
Allow: /project

按此网站分析http://tools.seobook.com/robots-txt/analyzer/

相关问题