【问题标题】:Magento, redirect the url from "www.domain.com/home" to base url "www.domain.com"Magento,将网址从“www.domain.com/home”重定向到基本网址“www.domain.com”
【发布时间】:2014-06-01 11:58:09
【问题描述】:

我正在尝试配置如何将我的 magento 网站从 www.domain.com/home 重定向到基本 url www.domain.com,它总是重定向到 www.domain.com/home

更新

谢谢阿米特,我用你的解决方案

RewriteEngine on
RewriteCond %{THE_REQUEST} ^.*/accueil
RewriteRule ^(.*)accueil$ http://www.cabas-durables.fr/$1 [R=301,L]

但我在浏览器上出现错误提示

页面未正确重定向

然后我将http://www.cabas-durables.fr/$1 之后的$1 更改为index.php,然后它在浏览器中显示“http://www.cabas-durables.fr/index.php”,然后我将它带回$1 我没有错误,但它保持为“ http://www.cabas-durables.fr/index.php"

我不知道在哪里把它改成只有“http://www.cabas-durables.fr/

如果不改变,我会遇到 SEO 问题

谢谢

【问题讨论】:

    标签: magento url base redirect


    【解决方案1】:

    使用 htaccess 会更好。 找到

    Options +FollowSymLinks
     RewriteEngine on 
    

    然后 将以下代码放入 htaccess 文件中

    RewriteCond %{THE_REQUEST} ^.*/home
    RewriteRule ^(.*)home$ http://www.domain.com/$1 [R=301,L] 
    

    【讨论】:

    • 嗨,Amit,感谢您的回复,代码已经存在:` RewriteCond %{REQUEST_METHOD} ^TRAC[EK] RewriteRule .* - [L,R=405]` 我应该更改它吗?或广告您的代码,谢谢
    • 找到了,要不要在下面写代码,我的主页叫“accueil”,要不要写RewriteCond %{THE_REQUEST} ^.*/accueil,谢谢
    • 请在保存文件前检查代码是否正确:` Options +FollowSymLinks RewriteEngine on RewriteCond %{THE_REQUEST} ^.*/accueil RewriteRule ^(.*)accueil$ cabas-durables.fr/$1 [R =301,L] `
    • 页面未正确重定向,我在浏览器中收到此消息
    • 我建议您编辑您的问题以粘贴您尝试但无法正常工作的代码。 Amit 的回答是正确的,如果您将其排版到您的问题中,我相信您或他会发现您的代码中的输入错误,以便我们都可以清楚地阅读它。
    【解决方案2】:

    在管理面板中创建 URL 重定向。

    使用 tagret 路径 - "../";它将重定向到主页。

    【讨论】:

      猜你喜欢
      • 2018-09-19
      • 1970-01-01
      • 1970-01-01
      • 2019-07-08
      • 1970-01-01
      • 1970-01-01
      • 2014-05-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多