【问题标题】:Some admin modules redirect to frontend一些管理模块重定向到前端
【发布时间】:2013-12-30 07:52:06
【问题描述】:

我在 Magento 中又创建了一家商店。在创建此商店之前,所有模块都运行良好。但是在创建了这个 store 之后,一些模块会重定向到前端。

我在谷歌上搜索了这个概念并得到了这个帖子https://magento.stackexchange.com/questions/4623/custom-admin-url-now-some-admin-modules-redirect-to-frontend

我已关注此线程的答案。但这对我不起作用。大多数线程的答案与此线程相同。

请救救我,伙计们。

谢谢

编辑

<?xml version="1.0"?>
 <config>
  <modules>
    <Chilly_Imageslide>
        <version>0.1.0</version>
    </Chilly_Imageslide>
</modules>
<frontend>
    <routers>
        <imageslide>
            <use>standard</use>
            <args>
                <module>Chilly_Imageslide</module>
                <frontName>imageslide</frontName>
            </args>
        </imageslide>
    </routers>
    <layout>
        <updates>
            <imageslide>
                <file>imageslide.xml</file>
            </imageslide>
        </updates>
    </layout>
</frontend>
<admin>
    <routers>
     <adminhtml>
        <use>admin</use>
        <args>
            <modules>
                <imageslide before="Mage_Adminhtml">Chilly_Imageslide_Adminhtml</imageslide>
            </modules>
        </args>
    </adminhtml>
        <!--<imageslide>
            <use>admin</use>
            <args>
                <module>Chilly_Imageslide</module>
                <frontName>imageslide</frontName>
            </args>
        </imageslide>-->
    </routers>
</admin>
<adminhtml>
   <menu>
        <imageslide module="imageslide">
            <title>Imageslide</title>
            <sort_order>71</sort_order>               
            <children>
                <items module="imageslide">
                    <title>Manage Items</title>
                    <sort_order>0</sort_order>
                    <action>imageslide/adminhtml_imageslide</action>
                </items>
            </children>
        </imageslide>
    </menu>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <imageslide>
                        <title>ImageSlide Module</title>
                        <sort_order>200</sort_order>
                    </imageslide>
                </children>
            </admin>
        </resources>   
    </acl>
    <layout>
        <updates>
            <imageslide>
                <file>imageslide.xml</file>
            </imageslide>
        </updates>
    </layout>
</adminhtml>   
<global>
    <models>
        <imageslide>
            <class>Chilly_Imageslide_Model</class>
            <resourceModel>imageslide_mysql4</resourceModel>
        </imageslide>
        <imageslide_mysql4>
            <class>Chilly_Imageslide_Model_Mysql4</class>
            <entities>
                <imageslide>
                    <table>imageslide</table>
                </imageslide>
            </entities>
        </imageslide_mysql4>
    </models>
    <resources>
        <imageslide_setup>
            <setup>
                <module>Chilly_Imageslide</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </imageslide_setup>
        <imageslide_write>
            <connection>
                <use>core_write</use>
            </connection>


        </imageslide_write>
        <imageslide_read>
            <connection>
                <use>core_read</use>
            </connection>
        </imageslide_read>
    </resources>
    <blocks>
        <imageslide>
            <class>Chilly_Imageslide_Block</class>
        </imageslide>
    </blocks>
    <helpers>
        <imageslide>
            <class>Chilly_Imageslide_Helper</class>
        </imageslide>
    </helpers>
</global>
</config>

【问题讨论】:

  • 你能发布一些你的代码吗?尤其是你的 config.xml。
  • 我已经添加了我的 config.xml 文件编码

标签: magento url redirect admin frontend


【解决方案1】:

我有一个解决方案。我们设置了一个条件,比如根据国家/地区重定向商店!英国人的主要商店。但我们在印度!所以对于管理员访问,我们有像

这样的写条件
 RewriteCond %{ENV:GEOIP_COUNTRY_CODE} IN$    
 RewriteCond %{REQUEST_URI} !admin [NC]
 RewriteRule ^ http://www.domain.in [R=301,L]

这意味着,当尝试访问印度的主要商店并且该网址不能包含关键字“admin”时,它将重定向到给定的域。尝试访问管理面板

但在我的自定义模块管理表单中,url 没有“admin”一词。所以只有它会重定向到另一家商店的前端。之后我对该 .htaccess 重定向代码进行了一些修改,现在它工作正常!

感谢所有审阅我的问题的人!

编辑:有关更多详细信息,请查看此帖子Magento redirection with htaccess based on country wise

【讨论】:

    猜你喜欢
    • 2014-07-04
    • 1970-01-01
    • 2013-01-11
    • 2015-10-03
    • 1970-01-01
    • 1970-01-01
    • 2020-12-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多