我的一些页面在链接检查器中得到 404,我可以在浏览器中正常打开,当我检查这些页面时,我还在谷歌网站管理员工具中收到无限循环警告,我找不到问题的根源!
这是整个故事:我有两个网站,w1 和 w2。过了一会儿,我决定把 w2 的内容移到 w1 的一个子目录下。所以,现在我在 W1 的根目录中有一个 CMS,在子目录中有另一个 CMS(第一个 CMS 是 TextPattern,第二个是 OpenCart)。我已将旧 w2 网站重定向到 w1 中的特定子目录。
旧 w2 中的 htaccess 包含:
Redirect 301 / w2/subdirectory?oldlink=
( ?oldlink= 可能看起来很愚蠢,但我不知道如何更好地做到这一点!)
w1根目录下的htaccess:
DirectoryIndex index.php index.html
Options +FollowSymLinks
Options -Indexes
ErrorDocument 403 default
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*) index.php
RewriteCond %{HTTP:Authorization} !^$
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#php_value register_globals 0
# SVG
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
最后,子文件夹中的 htaccess(在 w1 中,用于旧 w2 的内容):
Options +FollowSymlinks
# Prevent Directoy listing
Options -Indexes
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
# SEO URL Settings
RewriteEngine On
RewriteBase /subdirectory/
RewriteRule sitemap.xml /index.php?route=feed/google_sitemap
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
我的网页中没有任何重定向标签。子目录中一切正常;我可以打开页面,浏览它们等。
当我在在线链接检查器中检查 w1 时,子目录中的页面得到 404。当我使用 Fetch as Google 检查它时,它给了我“页面似乎重定向到自身。这可能会导致无限重定向循环。请查看有关重定向的帮助中心文章。” 警告,以下详细信息是:
HTTP/1.1 301 Moved Permanently
Date: Sun, 27 Oct 2013 16:42:24 GMT
Server: LiteSpeed
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
Location: the sub directory
X-Powered-By: PleskLin
Content-Type: text/html
Content-Length: 413
<html>
<head><title> 301 Moved Permanently
</title></head>
<body><h1> 301 Moved Permanently
</h1>
The document has been permanently moved to <A HREF="%s">here</A>.<hr />
Powered By <a href='http://www.litespeedtech.com'>LiteSpeed Web Server</a><br />
<font face="Verdana, Arial, Helvetica" size=-1>LiteSpeed Technologies is not responsible for administration and contents of this web site!</font></body></html>
所以,我真的很困惑。我找不到无限重定向的来源。谁能帮我这个?谢谢。