将网站重定向到新位置,但某些文件夹除外

时间:2016-09-05 15:08:25

标签: .htaccess bots

我正在尝试将我的网站内容重定向到机器人,但我希望保留一些文件夹。我想出了这个,但只有快照博客文件夹才能正常运行:

RewriteEngine on

# RewriteCond %{HTTP_USER_AGENT} (facebook|bot) [NC]
RewriteCond %{HTTP_USER_AGENT} (chrome) [NC]
RewriteCond %{REQUEST_URI} !^/3rdpt
RewriteCond %{REQUEST_URI} !^/blog
RewriteCond %{REQUEST_URI} !^/dist
RewriteCond %{REQUEST_URI} !^/snapshots
RewriteRule ^ /snapshots/$1index.html [L,R]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [L]
你可以给我一个提示吗?

非常感谢提前。

0 个答案:

没有答案
相关问题