Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess Magento multistore仅重定向一个domain.com,包括到https的路径_.htaccess_Magento_Redirect_Https_Multistore - Fatal编程技术网

.htaccess Magento multistore仅重定向一个domain.com,包括到https的路径

.htaccess Magento multistore仅重定向一个domain.com,包括到https的路径,.htaccess,magento,redirect,https,multistore,.htaccess,Magento,Redirect,Https,Multistore,我在magento上有多个域的多存储设置。 但我只希望一个特定的存储/域具有https,并将该域的所有非https URL重定向到https。包括整条路 例如,此列表中的所有URL都指向 源URL: http://webwinkel.nl/willekeurige-categorienam www.webwinkel.nl/willekeurige-categorienam http://www.webwinkel.nl/willekeurige-categorienam https://web

我在magento上有多个域的多存储设置。 但我只希望一个特定的存储/域具有https,并将该域的所有非https URL重定向到https。包括整条路

例如,此列表中的所有URL都指向

源URL: http://webwinkel.nl/willekeurige-categorienam www.webwinkel.nl/willekeurige-categorienam http://www.webwinkel.nl/willekeurige-categorienam https://webwinkel.nl/willekeurige-categorienam

目标url: https://www.webwinkel.nl/willekurige-categineaam

我把它用在一家商店,在这种情况下,它工作得很好

RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
但对于一个多商店来说,这是行不通的,因为它会将每个商店域重定向到https,但我只希望https用于一个特定的商店

编辑 @伊托克托普斯:谢谢你的回复

这适用于www.webwinkel.nl。 但不适用于同一多存储上的其他域

例如,我有www.webwinkel.nl、www.webwinkel2.nl和www.webwinkel3.nl。 使用您的代码,它们都将重定向到www.webwinkel.nl

这是我现在的全部访问权限:

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} ^(.*)webwinkel.nl [NC] 
RewriteRule . - [E=MAGE_RUN_TYPE:website]
RewriteCond %{HTTP_HOST} ^(.*)webwinkel.nl [NC] 
RewriteRule . - [E=MAGE_RUN_CODE:webwinkel] 

RewriteCond %{HTTP_HOST} ^(.*)webwinkel2.nl [NC] 
RewriteRule . - [E=MAGE_RUN_TYPE:website]
RewriteCond %{HTTP_HOST} ^(.*)webwinkel2.nl [NC] 
RewriteRule . - [E=MAGE_RUN_CODE:webwinkel2] 

RewriteCond %{HTTP_HOST} ^(.*)webwinkel3.nl [NC] 
RewriteRule . - [E=MAGE_RUN_TYPE:website]
RewriteCond %{HTTP_HOST} ^(.*)webwinkel3.nl [NC] 
RewriteRule . - [E=MAGE_RUN_CODE:webwinkel3] 


# First condition - redirect non-www to www for all domains
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# Second condition - redirect HTTP to HTTPS for a particular domain
RewriteCond %{HTTP_HOST} ^webwinkel\.nl$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.webwinkel.nl/$1 [R=301,L]

将以下代码添加到
.htaccess
文件中,以确保只有特定域被重定向到
https://www
。第一个条件是为所有其他域处理从非www到www的重定向。第二个条件是将域重定向到https

RewriteEngine On
# First condition - redirect non-www to www for all domains
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# Second condition - redirect HTTP to HTTPS for a particular domain
RewriteCond %{HTTP_HOST} ^webwinkel\.nl$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.webwinkel.nl/$1 [R=301,L]

将以下代码添加到
.htaccess
文件中,以确保只有特定域被重定向到
https://www
。第一个条件是为所有其他域处理从非www到www的重定向。第二个条件是将域重定向到https

RewriteEngine On
# First condition - redirect non-www to www for all domains
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# Second condition - redirect HTTP to HTTPS for a particular domain
RewriteCond %{HTTP_HOST} ^webwinkel\.nl$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.webwinkel.nl/$1 [R=301,L]

关于这个主题的任何新闻,我在寻找相同的东西?关于这个主题的任何新闻,我在寻找相同的东西?