【问题标题】:how to remove index.php without other urls and have a referral 301 redirect如何在没有其他 url 的情况下删除 index.php 并进行推荐 301 重定向
【发布时间】:2020-06-28 16:25:51
【问题描述】:

我正在使用此代码删除 opencart 的 index.php。不过,还有其他地址:

/index.php?route=account/register

当然,代码开始到处删除 index.php。 由于内容重复,我的目标是为 SEO 删除它(index.php)。

我用这个

Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ https://website.com/$1 [R=301,L]

【问题讨论】:

  • 这个问题似乎是题外话,因为它是关于 SEO 这在 Stack Overflow 上是题外话。请阅读"Which SEO questions should be closed as non-programming/non-admin?",以更好地了解何时可以在此处提出 SEO 问题(大多数情况不可以)以及您可以在哪里获得帮助。
  • 这里的问题究竟是什么?您的指令是否出现错误或不正确的重定向? (您是否从 HTML 源代码中的 URL 中删除了 index.php?)

标签: .htaccess redirect seo opencart opencart-3


【解决方案1】:

要使用 SEO URL,必须安装 apache 模块 mod-rewrite,并且您需要将 htaccess.txt 重命名为 .htaccess

然后在 Opencart 的管理员中转到 System > Settings > Edit Store > Settings > Server > Use SEO URLs > YES

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-12
    • 1970-01-01
    相关资源
    最近更新 更多