apache_conf htaccess Trailing Slash

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf htaccess Trailing Slash相关的知识,希望对你有一定的参考价值。

# http://socreativedigital.com/7-htaccess-file-examples-that-work-for-seo-2013-05-04
# After adding the code for clean URL’s I found that some pages had a trailing
# slash at the end of the URL and others did not. The trailing slash denotes a
# directory and those without a trailing slash denote a file. In most cases both
# versions of these URLS’s will have the same content which is a problem for
# search engines as they do not know which one to serve and will see them as
# duplicate content.
#
# There is htaccess code which you can implement in your file which will either
# remove the slash from all URL’s or add the slash. It is your choice as to which
# one you have, and as long as you choose one or the other, again, search engines
# are happy as it resolves the issue of duplicate content. Below is the code to
# remove the trailing slash:
#
RewriteEngine On
RewriteRule ^(.*)/$ http://%{HTTP_HOST}/$1

以上是关于apache_conf htaccess Trailing Slash的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf [linux:.htaccess] apache的htaccess说明。 #linux #apache

apache_conf Seguridad .htaccess

apache_conf htaccess的

apache_conf 重定向htaccess

apache_conf [htaccess的]

apache_conf HtAccess重写规则