Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Seo 我应该如何在prestashop主题中实现规范URL?_Seo_Prestashop_Canonical Link - Fatal编程技术网

Seo 我应该如何在prestashop主题中实现规范URL?

Seo 我应该如何在prestashop主题中实现规范URL?,seo,prestashop,canonical-link,Seo,Prestashop,Canonical Link,规范URL当前在商店中激活,但不会在前端源代码中编写。所以我甚至查看了默认的bootsrap主题,最后一个来自github,但它似乎没有实现任何规范的url 我还检查了所有的控制器,但似乎没有人设置$canonical_url(类似..)smarty var,那么相关的后台选项是什么呢 我在网上搜索了一下,但没有发现什么真正有用的东西。后台选项Canonical url只在控制器中使用 如果已激活url重写选项并尝试访问此链接: http://dev.test.com/index.php?id_

规范URL当前在商店中激活,但不会在前端源代码中编写。所以我甚至查看了默认的bootsrap主题,最后一个来自github,但它似乎没有实现任何规范的url

我还检查了所有的控制器,但似乎没有人设置$canonical_url(类似..)smarty var,那么相关的后台选项是什么呢


我在网上搜索了一下,但没有发现什么真正有用的东西。

后台选项Canonical url只在控制器中使用

如果已激活url重写选项并尝试访问此链接:

http://dev.test.com/index.php?id_product=1&controller=product
您将被重定向到,例如:

http://dev.test.com/tshirts/1-T-shirts-a-manches-courtes-delaves.html
以下是
FrontController
类中
canonicalRedirection
方法的摘录:

/**
*重定向到规范URL
*
*@param string$canonical\u url
*/
受保护函数canonicalRedirection($canonical_url='')
{
[...]
$redirect_type=Configuration::get('PS_CANONICAL_redirect')==2?'301':'302';
标题('HTTP/1.0'.$redirect_type.'Moved');
标头(“缓存控制:无缓存”);
工具::重定向链接($final_url);
}
在这种方法中,我们使用以下行获取您在BackOffice中选择的规范重定向选项
Configuration::get('PS\u canonical\u redirect')

如果您想在html标题中使用规范url,您必须为此编写或获取一个模块,因为它不包含在Prestashop中