codeigniter 重定向和搜索引擎机器人
codeigniter redirects and search engine bots
我是 codeigniter 的新手。事实上,我什至没有在努力。我只是受雇为一个网站做 SEO。我只能访问该站点的 cpanel,不能访问 codeigniter 的仪表板(不知道有没有?)
到目前为止,我已经能够找出所有需要我注意的事情。现在唯一的问题是搜索机器人似乎正在点击重定向。当我尝试以 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}/ [R=301,L]
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ / [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
我需要在 .htaccess 文件中添加什么才能让搜索引擎抓取网站而无需再次访问 http 301?谢谢
为什么将这段代码放在 .htaccess 文件中?
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ / [L,R=301]
我是 codeigniter 的新手。事实上,我什至没有在努力。我只是受雇为一个网站做 SEO。我只能访问该站点的 cpanel,不能访问 codeigniter 的仪表板(不知道有没有?)
到目前为止,我已经能够找出所有需要我注意的事情。现在唯一的问题是搜索机器人似乎正在点击重定向。当我尝试以 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}/ [R=301,L]
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ / [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
我需要在 .htaccess 文件中添加什么才能让搜索引擎抓取网站而无需再次访问 http 301?谢谢
为什么将这段代码放在 .htaccess 文件中?
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ / [L,R=301]