【发布时间】:2016-12-10 13:10:25
【问题描述】:
我正在使用 Magento 构建一个虚拟商店,并且我正在使用带有 "M" plan 的 HostGator 托管,它支持多个站点,问题是 Magento 在根目录中,而我在里面还有另一个站点文件夹/example.com.br,但是当我尝试通过浏览器访问此站点时:
http://example.com.br
我被重定向到 Magento 网站:
http://magentosite.com.br/maintenance.html
根文件夹(magento 的 htaccess)上的 htaccess 正在重定向到 magento 维护页面 http://magentosite.com.br/maintenance.html,我只需要保留 Magento 进行维护,而不是某些文件夹中的站点,例如文件夹 /example.com.br, /example2.com.br等等……
这是我在 Magento 中使用的维护代码(在 Root 中):
RewriteEngine On
RewriteBase /
# allow my ip to access magento store
RewriteCond %{REMOTE_ADDR} !^177\.18\.228\.58
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ https://magentosite.com.br/maintenance.html [R=307,L]
我尝试了这个解决方案https://stackoverflow.com/a/6528448/2761794,但对我不起作用...
【问题讨论】:
标签: apache .htaccess magento redirect maintenance-mode