2013-05-01 106 views
0

我使用的是magento网站,通过http和https访问网站上的所有网页,这可能会导致Google重复出现内容问题。我需要适当的编码在htacces重定向所有https网页这些网页的例外为http:将https重定向到.htacces中,但有一些例外情况

(不知道你需要为这些还是我一个单独的例外规则T公司的包括以前的)

  • /结算/ multishipping /地址/
  • /心愿/指数/指数/
  • /客户/帐号/登录/
  • /结算/ onepage /成功

非常感谢,如果任何人都可以提供帮助。谢谢。

回答

0

尝试:

RewriteEngine On 

# From https to http 
RewriteCond %{HTTPS} on 
RewriteCond %{REQUEST_URI} !^/checkout/onepage/ 
RewriteCond %{REQUEST_URI} !^/customer/account/ 
RewriteCond %{REQUEST_URI} !^/checkout/multishipping/login/ 
RewriteCond %{REQUEST_URI} !^/wishlist/ 
RewriteCond %{REQUEST_URI} !^/index.php/admin/dashboard/index/key/ 
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] 

# From http to https 
RewriteCond %{HTTPS} off 
RewriteCond %{REQUEST_URI} ^/checkout/onepage/ [OR] 
RewriteCond %{REQUEST_URI} ^/customer/account/ [OR] 
RewriteCond %{REQUEST_URI} ^/checkout/multishipping/login/ [OR] 
RewriteCond %{REQUEST_URI} ^/wishlist/ [OR] 
RewriteCond %{REQUEST_URI} ^/index.php/admin/dashboard/index/key/ 
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301] 
+0

我试了一下,该网站上的所有常规页面,如果你以https尝试将适当重定向到HTTP,但是当我试图访问任何需要被页面保证例如愿望清单页面,我看到页面更改为https,然后重定向到主页。这可能是因为那些需要安全的页面在我加入此代码之前已被重定向到https。或者在htacces编码中可能存在某种冲突?我可以上传.htacces文件,如果你想看到它。 – 2013-05-02 00:54:43