php - Opencart 3 .x SEO Url 不适用于 route=information/contact, route=account/login

标签 php .htaccess opencart opencart-3

opencart 3.x SEO URL 问题

在 opencart 3 .x SEO URL 中适用于产品 ID、类别 ID、信息 ID,但对于页面公共(public)/主页、帐户/登录、帐户/帐户等无效。

我已经将它从 htaccess.txt 更改为 .htaccess

从系统更改 > 设置 > 服务器

enter image description here

我在设计 > SEO Url 中从管理员添加 SEO url

enter image description here

还是不行

你们能帮帮我吗?

谢谢你,

最佳答案

Opencart 3.x SEO URL 问题已解决只需上传扩展或按照此步骤操作即可。

它对 product_id、category_id 等工作正常...

但是对于任何页面它都不起作用

点击此处修复扩展

https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=31993

此步骤仅适用于不想安装插件的开发人员

现在我要看看我们如何解决 opencart 3.x seo 问题。

第 1 步 - 打开您的 ftp 并转到此路径 catalog/controller/startup

第 2 步 - 打开 seo_url.php 进行编辑

第 3 步 - 第 87 行我们必须再放一个其他的如果

代码:

} elseif ($key == 'route') {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($value) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
unset($data[$key]);
} else if ($data['route'] == "common/home") {
$url .= '/';
}

结束代码:

第 4 步 - 将 .htaccess.txt 重命名为 .htaccess

此视频仅供开发者使用

https://youtu.be/bS1N_twvL4o

任何主题兼容。

前端演示

http://demo.sainent.com

管理演示

http://demo.sainent.com/admin

用户名:demo

密码:演示

关于php - Opencart 3 .x SEO Url 不适用于 route=information/contact, route=account/login,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46255251/

相关文章:

php - phantomJS : Absolute path working, 但相对路径给出问题

css - 将 CSS 样式表添加到基于 OpenCart 中的路由的页面

performance - Opencart极慢的加载速度

php - 如果行不存在则加载数据INFILE

php警告为什么?无法解决

apache - 为 CloudFlare 用户强制使用 .htaccess 的 HTTPS 和非 WWW

html - 如何将主域重定向到另一个域但不在重定向中包含子域 - htaccess

MySQL INSERT INTO 使用 WHERE 子句

php - 无法在 CentOS 7 上的 PHP 中打开 file_put_contents 上的流

apache - 如何使用 .htaccess 创建重定向以正确的路径而不是页面访问