【发布时间】:2016-06-12 00:48:25
【问题描述】:
我是 Codeigniter 的新手。事实上,我什至没有工作。我只是受雇为网站做 SEO。我只能访问网站的cpanel,不能访问codeigniter的dashboard(不知道有没有?)
到目前为止,我已经能够弄清楚所有需要我注意的事情。现在唯一的问题是搜索机器人似乎正在重定向。当我尝试作为 Bingbot 获取时,我得到以下信息
HTTP/1.1 301 Moved Permanently
Connection: close
Date: Sun, 12 Jun 2016 00:34:29 GMT
Content-Length: 234
Content-Type: text/html; charset=iso-8859-1
Location: http://www.domain.com/
Server: Apache
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.domain.com/">here</a>.</p>
</body></html>
我认为这可能是写入 .htaccess 的重定向规则。但我真的不知道要改变什么才能让机器人顺利抓取网站。查看下面的 .htaccess。
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
我需要在 .htaccess 文件中添加什么内容才能让搜索引擎在不再次访问 http 301 的情况下抓取该网站?谢谢
【问题讨论】:
标签: .htaccess codeigniter redirect search-engine