【问题标题】:Magento: New website with redirects from old but still need admin access on old site(s)Magento:具有旧网站重定向的新网站,但仍需要旧网站的管理员访问权限
【发布时间】:2018-01-02 15:13:54
【问题描述】:

我们为客户建立了一个新的 Magento2 网站。他们有几个旧的 Magento1 网站需要重定向到这个站点,所以我在 .htaccess 中设置了标准的 301 重定向到新站点。到目前为止一切顺利。

问题是客户仍然希望管理员访问旧的 magento 站点以查看订单和销售信息等。现在 .htaccess 重定向上的一个简单异常 '^/admin' 确实并最终重定向到 index.php新网站。请注意,我已将原始 magento 重定向保留在原处。

反正有这个吗? 这是我到目前为止添加的内容 - 这是在 Magento 重定向之前就位的。

RewriteEngine on
RewriteCond %{HTTP_HOST} ^oldsite\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.oldsite\.co\.uk$
RewriteCond %{REQUEST_URI} !^/admin
RewriteRule ^(.*)$ "https\:\/\/www\.newsite\.co\.uk\/$1" [R=301,L]

【问题讨论】:

    标签: .htaccess magento redirect


    【解决方案1】:

    啊,从另一个站点发现的,这适用于管理 url http://oldsite.co.uk/index.php/admin

    RewriteEngine on 
    RewriteBase / 
    RewriteCond %{REQUEST_URI} !^/admin
    RewriteCond %{REQUEST_URI} !^admin
    RewriteCond %{REQUEST_URI} !^/skin
    RewriteCond %{REQUEST_URI} !^/js
    RewriteCond %{REQUEST_URI} !^/media
    RewriteCond %{REQUEST_URI} !^/index.php/admin
    RewriteCond %{REQUEST_URI} !^index.php/admin
    RewriteRule (.*) https://www.newsite/$1 [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 2017-09-25
      • 1970-01-01
      • 2017-08-10
      • 2013-06-05
      • 2015-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多