Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.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
Regex 规范标记和文件扩展名_Regex_Apache_.htaccess_Mod Rewrite_Canonical Link - Fatal编程技术网

Regex 规范标记和文件扩展名

Regex 规范标记和文件扩展名,regex,apache,.htaccess,mod-rewrite,canonical-link,Regex,Apache,.htaccess,Mod Rewrite,Canonical Link,我只是想知道,我使用.htaccess脚本从我的URL 例如,canonical标记(您希望用户看到的直接URL)是否包含文件扩展名 mysite.co.uk/locations/regions/thislocation.html 我的实际url的外观示例 <link rel="canonical" href="http://mysite.co.uk/locations/regions/thislocation"/> 规范标签是用上面的URL设置的还是用文件扩展名设

我只是想知道,我使用
.htaccess
脚本从我的
URL

例如,canonical标记(您希望用户看到的直接
URL
)是否包含文件扩展名

 mysite.co.uk/locations/regions/thislocation.html
我的实际url的外观示例

    <link rel="canonical" href="http://mysite.co.uk/locations/regions/thislocation"/>


规范标签是用上面的URL设置的还是用文件扩展名设置的

规范URL应该表示您希望用户访问的URL(并在其地址栏中查看),而不是仅作为实现的副作用存在的URL(其目的是停止搜索引擎索引的
.html
版本).

@anubhava您必须设置一个不带扩展名的规范标记。因为google会抓取显示在您标题中的URL

因此,链接将是: