从OpenCart移除index.php?route = common/home [英] Remove index.php?route=common/home from OpenCart

查看:332
本文介绍了从OpenCart移除index.php?route = common/home的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在OpenCart管理员中将User SEO URL's设置为是".

I currently have User SEO URL's set to Yes in OpenCart Admin.

System -> Settings -> Store -> Server -> User SEO URL's

到目前为止,所有标签和SEO链接都可以使用;该命令已达到预期的效果.

So far, all tags and SEO links are working; the command has done the desired effect.

但是对于主页和其他一些链接;如何删除:

However for the homepage and a few other links; how do I remove:

index.php?route = common/home

index.php?route=common/home

来自URL?我是否必须从字面上进行查找并替换硬代码PHP文件并冒险升级,或者还有其他方法吗?

From the URL? Do I have to literally do a find and replace in the hardcode PHP files and risk upgrades or is there another way?

(不具有膨胀性能,即没有任何劣质的业余工具,例如vQmod)

(without bloating performance i.e no poor amateur tools such as vQmod)

推荐答案

要简单地删除它,可以在/catalog/controller/common/seo_url.php

To simply remove that, you can do a basic replace in /catalog/controller/common/seo_url.php

查找:

return $link;

之前将其放在新行上:

$link = str_replace('index.php?route=common/home', '', $link);

TheBlackBenzKid如果您想使用完整的SEO,请使用此行代替上面的内容:

Edit by TheBlackBenzKid: If you want full SEO just use this line instead of the above:

$link = str_replace('index.php?route=', '', $link);

还要确保在商店的管理"面板中打开了SEO URL.

Also make sure SEO URLs is turned on in the Admin panel of the store.

这篇关于从OpenCart移除index.php?route = common/home的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆