Html 在所有阶段进行清洁

Html 在所有阶段进行清洁,html,.htaccess,rewrite,slash,Html,.htaccess,Rewrite,Slash,问题是斜杠/“示例.ru/aboutus/”转换为“500服务器错误””并附加http://example.ru/aboutus/.html在uri的末尾 .HTACCESS 但在输入斜杠时,我输入了500页的错误 HTML html代码页中的没有任何链接。html扩展名 ``除了`` 问题: (对吗?) (canonical能否在html中提供帮助?) (是否要禁止Robots.txt*.html?) 如何解决没有重复的问题,使所有页面都没有斜杠和扩展名.html?搜索引擎优化所需的一

问题是斜杠
/
示例.ru/aboutus/
”转换为“500服务器错误””并附加
http://example.ru/aboutus/.html
在uri的末尾

.HTACCESS 但在输入斜杠时,我输入了500页的错误


HTML html代码页中的
没有任何链接。html扩展名
``除了``
问题:
  • (对吗?)
  • (canonical能否在html中提供帮助?)
  • (是否要禁止Robots.txt*.html?)

如何解决没有重复的问题,使所有页面都没有斜杠和扩展名.html?搜索引擎优化所需的一切都找到了解决方案

Options All -ExecCGI -Multiviews -Indexes -Includes +FollowSymLinks

# This tag ensures the rewrite module is loaded
<IfModule mod_rewrite.c>
  # enable the rewrite engine
  RewriteEngine On
  # Set your root directory
  RewriteBase /

# remove the www extension
  RewriteCond %{THE_REQUEST} ^.*/index\.html 
  RewriteRule ^(.*)index.html$ /$1 [R=301,L]
  RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

  # remove the .html extension
  RewriteCond %{THE_REQUEST} ^GET\ (.*)\.html\ HTTP
  RewriteRule (.*)\.html$ $1 [R=301]

  # remove index and reference the directory
  RewriteRule (.*)/index$ $1/ [R=301]

  # remove trailing slash if not a directory
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} /$
  RewriteRule (.*)/ $1 [R=301]

  # forward request to html file, **but don't redirect (bot friendly)**
  RewriteCond %{REQUEST_FILENAME}.html -f
  RewriteCond %{REQUEST_URI} !/$
  RewriteRule (.*) $1\.html [L]
</IfModule>
Options All-ExecCGI-Multiviews-index-Includes+FollowSymLinks
#此标记确保已加载重写模块
#启用重写引擎
重新启动发动机
#设置根目录
重写基/
#删除www扩展名
重写cond%{THE_REQUEST}^.*/index\.html
重写规则^(.*)index.html$/$1[R=301,L]
重写条件%{HTTP_HOST}^www\.(.*)$[NC]
重写规则^(.*)$http://%1/$1[R=301,L]
#删除.html扩展名
重写cond%{u请求}^GET\(.*)\.html\HTTP
重写规则(.*)\.html$$1[R=301]
#删除索引并引用目录
重写规则(.*)/索引$$1/[R=301]
#如果不是目录,请删除尾部斜杠
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_URI}/$
重写规则(.*)/$1[R=301]
#将请求转发到html文件,**但不重定向(机器人友好型)**
RewriteCond%{REQUEST_FILENAME}.html-f
重写cond%{REQUEST_URI}/$
重写规则(.*)$1\.html[L]

in the html code pages do not have any links .html extension
`<a href=aboutus>About Us</a>` except `<a href=index.html>index</a>`
Options All -ExecCGI -Multiviews -Indexes -Includes +FollowSymLinks

# This tag ensures the rewrite module is loaded
<IfModule mod_rewrite.c>
  # enable the rewrite engine
  RewriteEngine On
  # Set your root directory
  RewriteBase /

# remove the www extension
  RewriteCond %{THE_REQUEST} ^.*/index\.html 
  RewriteRule ^(.*)index.html$ /$1 [R=301,L]
  RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
  RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

  # remove the .html extension
  RewriteCond %{THE_REQUEST} ^GET\ (.*)\.html\ HTTP
  RewriteRule (.*)\.html$ $1 [R=301]

  # remove index and reference the directory
  RewriteRule (.*)/index$ $1/ [R=301]

  # remove trailing slash if not a directory
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} /$
  RewriteRule (.*)/ $1 [R=301]

  # forward request to html file, **but don't redirect (bot friendly)**
  RewriteCond %{REQUEST_FILENAME}.html -f
  RewriteCond %{REQUEST_URI} !/$
  RewriteRule (.*) $1\.html [L]
</IfModule>