没有https的类别和网址重定向到magento的主页

时间:2017-05-04 13:07:41

标签: .htaccess magento ssl redirect https

我们在我们的网站启用了https,并在管理部分启用了301。 但问题在于类别或产品网址

示例:我有https://www.boxdoccia.it/box-doccia/box-doccia-angolari/,当更改为http://www.boxdoccia.it/box-doccia/box-doccia-angolari/时返回主页

Magento 1.7.0.2 -multiple store(仅限boxdoccia.it的ssl)

- 自动重定向到基本网址 - >是301

- 安全和不安全的网址 - > https://www.boxdoccia.it

这是htaccess:

<IfModule mod_ssl.c>

############################################

## make HTTPS env vars available for CGI mode

    SSLOptions StdEnvVars

</IfModule>

<IfModule mod_rewrite.c>

############################################

## enable rewrites

    Options +FollowSymLinks	

    RewriteEngine on

############################################


## workaround for HTTP authorization

## in CGI environment


    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]


############################################

## TRACE and TRACK HTTP methods disabled to prevent XSS attacks


    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]

    RewriteRule .* - [L,R=302]

############################################

## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################

## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteCond %{REQUEST_FILENAME} !-l


############################################

## rewrite everything else to index.php

    RewriteRule .* index.php [L]

</IfModule>

############################################

## Prevent character encoding issues from server overrides

## If you still have problems, use the second line instead

    AddDefaultCharset Off

    #AddDefaultCharset UTF-8

    FileETag none

#####

RewriteCond %{HTTP_HOST} ^(.*)boxdoccia.it
RewriteRule ^ - [E=MAGE_RUN_CODE:boxdoccia_it]
RewriteCond %{HTTP_HOST} ^(.*)boxdoccia.it
RewriteRule ^ - [E=MAGE_RUN_TYPE:website] 
RewriteCond %{HTTP_HOST} ^(.*)allandmore.com
RewriteRule ^ - [E=MAGE_RUN_CODE:allandmore_com]
RewriteCond %{HTTP_HOST} ^(.*)allandmore.com
RewriteRule ^ - [E=MAGE_RUN_TYPE:website]
RewriteCond %{HTTP_HOST} ^(.*)piattodoccia.it
RewriteRule ^ - [E=MAGE_RUN_CODE:piattodoccia_it]
RewriteCond %{HTTP_HOST} ^(.*)piattodoccia.it
RewriteRule ^ - [E=MAGE_RUN_TYPE:website]

1 个答案:

答案 0 :(得分:1)

之后试试    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]