我有一个.htaccess
有多个规则,3个有一个硬编码的网址用于Magento商店:
1)要从URL中删除端口号,该站点在Docker容器中运行,Apache和Nginx在主机上运行,以将流量转发到正确的容器。出于某种原因,:80
被添加到网址中,此规则将其删除:
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://domain.nl/$1 [L,R=301]
2)从网址中删除index.php
:
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ https://domain.nl/$1 [R=301,L]
3)将/home
重定向到/
:
redirect 301 /home https://domain.nl
现在,我想在此Magento安装中运行多个商店,以便将多个域名链接到此安装。由于硬编码的网址,此.htaccess
冲突。我试图使这些通用,但我最终得到500错误。如何使这3条规则通用?
答案 0 :(得分:0)
<强> 1)强>
$("#files").change(function() {
filename = this.files[0].name
console.log(filename);
});
2)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<label for="files" class="btn">Select Image</label>
<input id="files" style="visibility:hidden;" type="file">
</div>
3)
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^([^:]+)(:[0-9]+)?$
RewriteRule ^(.*)$ https://%1/$1 [L,R=301]