0

今天早上突然间,我在访问我的网站的主页时遇到了问题。我没有做任何更改,所以我不确定问题是什么。我猜它与我的 .htaccess 文件有关。

我网站的所有其他页面,我可以毫无问题地访问。

下面是我的 htaccess 文件。任何帮助,将不胜感激。提前致谢。

Options -Indexes
Options +FollowSymLinks

RewriteEngine   on
RewriteRule ^hats-n-caps/(.*)$ http://www.domain-domain.com/apparel/hats-n-caps/$1 [R=301,L]
RewriteRule ^electronics/laser-pointers/(.*)$ http://www.domain-domain.com/desktop-office/laser-pointers/$1 [R=301,L]
#RewriteCond %{HTTP_HOST} !^www.domain-domain.com$ [NC]
#RewriteRule ^(.*)$ http://www.domain-domain.com/$1 [L,R=301]

RewriteCond %{REQUEST_URI}  (^(.*)/site-map)
RewriteRule ^site-map$ /inc/pages/site-map.php [L]
RewriteCond %{REQUEST_URI}  (^(.*)/site-map/products-([0-9]+))
RewriteRule ^site-map/products-([0-9]+)$ /inc/pages/site-map.php?type=product&page=$1 [L]
RewriteCond %{REQUEST_URI}  (^(.*)/site-map/catalogs-([0-9]+))
RewriteRule ^site-map/catalogs-([0-9]+)$ /inc/pages/site-map.php?type=catalog&page=$1 [L]
RewriteCond %{REQUEST_URI}  (^(.*)/site-map/pages-([0-9]+))
RewriteRule ^site-map/pages-([0-9]+)$ /inc/pages/site-map.php?type=pages&page=$1 [L]

RewriteCond %{REQUEST_URI}  (^(.*)-p-(.*).html*)
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}[L]
RewriteCond %{REQUEST_URI}  (^(.*)-c-(.*).html*)
RewriteRule ^(.*)-c-(.*).html$ product_info.php?catalog_id=$2&%{QUERY_STRING}[L]
RewriteCond %{REQUEST_URI}  !(^(.*)-c-(.*).html*|^(.*)-p-(.*).html*|^/index.php|^/sitemap.xml.*|^/info.php.*|^/google_base_feed.xml.*|^/BingSiteAuth.xml.*|^/test.html.*|^/test.*|^/ajaxplorer.*|/livechat.*|^/phpmyadmin.*|^/ControlPanel.*|^/actikare.*|^/amwater.*|^/phi.*|^/sas.*|^/blog.*|^/cfscg.*|^/chase.*|^/cleaver.*|^/clubz.*|^/medicone.*|^/net2ftp.*|^/college-net.*|^/ducks.*|^/fast-teks.*|^/gatesgroup.*|^/guesthouse.*|^/neighborcare.*|^/pdf.*|^/reedrill.*|^/survey.*|^/temp.*|^/templates.*|^/tidewater.*|^/tuthill.*|^/uploads.*|^/upload.*|^/_include.*|^/product_info.*|^/server_request.*|^/server_request_products.*|^/admin.*|^/img/.*|^/images/.*|^/spaw2?|^/static/.*|^/tmp/|^/_include/|^/robots.txt|^/LiveSearchSiteAuth.xml|^/favicon.ico|/SiteReturn/.*|^/inc/pages/site-map.php(.*)|^/carousel_products.php)
RewriteRule (.*)$   /index.php [L]
RewriteCond %{HTTP_HOST} ^domain-domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain-domain.com$
RewriteRule ^/?$ "\/" [R=301,L]


RewriteCond %{HTTP_HOST} ^domaindomain\.co$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domaindomain\.co$
RewriteRule ^/?$ "\/" [R=301,L]
4

1 回答 1

0

这一行:

RewriteRule ^/?$ "\/" [R=301,L]

是什么导致您的重定向循环。摆脱整个规则:

# RewriteCond %{HTTP_HOST} ^domaindomain\.co$ [OR]
# RewriteCond %{HTTP_HOST} ^www\.domaindomain\.co$
# RewriteRule ^/?$ "\/" [R=301,L]

它本质上将请求重定向到根/到它自己。

于 2013-09-16T16:03:05.787 回答