Magento站点切换的.htaccess [英] Magento site switching .htaccess

查看:213
本文介绍了Magento站点切换的.htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试了几个小时,以获得不同的商店,显示基于一个子目录。我们的临时网站设立了Magento的是世界,美国,英国的休息和澳大利亚的商店以及它们之间的差异。我们不得不通过设置环境变量中的.htaccess这些工作(我将使用基础和澳大利亚的商店只为简洁起见),然后再在index.php文件来加载正确的商店。

I'm been trying for several hours to get a different store to display based on a subdirectory. Our staging site set up for Magento is for a Rest of the World, US, UK and Australian stores with various differences between them. We have had these working by set environmental variables in the .htaccess (I'll use the base and Australian store only for brevity), which are then used in the index.php file to load the correct store.

SetEnvIf Host staging\.hostname\.com MAGE_RUN_CODE=base
SetEnvIf Host staging\.hostname\.com MAGE_RUN_TYPE=store

SetEnvIf Host staging-au\.hostname\.com MAGE_RUN_CODE=au
SetEnvIf Host staging-au\.hostname\.com MAGE_RUN_TYPE=website

我现在已经被委托改变这种使用子目录,所以staging.hostname.com/au/,不管我把不工作。

I've now been tasked with changing this to use subdirectories, so staging.hostname.com/au/ , and whatever I put in doesn't work.

我已经改变了基本URL不同存储在配置为指向staging.hostname.com/au/为澳大利亚商店。从我可以看到它不是拿起我的新的.htaccess行

I've changed the base url for the different stores in the configuration to point at staging.hostname.com/au/ for the Australian store. From what I can see it's not picking up my new .htaccess lines of

SetEnvIf Request_URI "^/au/.*" MAGE_RUN_CODE=au
SetEnvIf Request_URI "^/au/.*" MAGE_RUN_TYPE=website

我已经试过了常规EX pression带和不带引号,并且有和没有任何通配符(*),并没有喜悦。

I've tried the regular expression with and without quotation marks, and with and without the wildcard anything (.*) and no joy.

我并确保删除/注释掉SetEnvIf之后主机线为好,否则它可能会导致问题,因为我想设置环境变量的两倍。

I did ensure to delete / Comment out the SetEnvIf Host lines as well, as otherwise it would probably be causing problems as I'd set the environmental variable twice.

如果我离开老URL指向商店(staging-au.hostname.com),然后Magento的重定向到staging.hostname.com/au的商店的基本URL(这样就意味着旧的.htaccess信息工程),但它默认回到基地存储值,给我一个404错误。

If I leave the old url pointing at the store (staging-au.hostname.com) then Magento redirects to the store's base URL of staging.hostname.com/au (so that means the old .htaccess information works), but then it defaults back to the base store values and gives me a 404 error.

任何帮助将是很大的AP preciated。

Any help would be greatly appreciated.

的Apache 2.2.21版本,有没有什么帮助。

Apache version 2.2.21 if that helps.

推荐答案

这将取决于你如何设置了美国,英国等假设他们建立的商店,你应该简单地能够使系统>配置>网络> URL选项>添加存储code到URL,而不是通过你的.htaccess REQUEST_URI得一塌糊涂左右。

This will depend how you've set up US, UK etc. Assuming they are set-up as stores you should simply be able to enable System > Configuration > Web > URL Options > Add Store Code to Urls, and not have to mess around with your request_uri via .htaccess.

这篇关于Magento站点切换的.htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆