Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
.htaccess 如何在htaccess中使用.html扩展名410所有URL_.htaccess_Http Status Code 410 - Fatal编程技术网

.htaccess 如何在htaccess中使用.html扩展名410所有URL

.htaccess 如何在htaccess中使用.html扩展名410所有URL,.htaccess,http-status-code-410,.htaccess,Http Status Code 410,我想要410个扩展名为.html的所有URL 说xx.html,yy.html(全部带有.html) 如何使用htacess Rewrite或redirect 410规则实现这一点?HTTP status410表示“消失”,这可以通过mod\u Rewrite中的[G]标志来实现 RewriteRule \.html$ - [G] 请参阅和。HTTP status410表示“消失”,这可以通过mod_rewrite中的[G]标志来完成 RewriteRule \.html$ - [G] 请参

我想要410个扩展名为.html的所有URL

说xx.html,yy.html(全部带有.html)


如何使用htacess Rewrite或redirect 410规则实现这一点?

HTTP status
410
表示“消失”,这可以通过mod\u Rewrite中的
[G]
标志来实现

RewriteRule \.html$ - [G]

请参阅和。

HTTP status
410
表示“消失”,这可以通过mod_rewrite中的
[G]
标志来完成

RewriteRule \.html$ - [G]

请参阅和。

在.htaccess文件中使用此选项

RewriteEngine On
RewriteRule \.html$ - [G]

在.htaccess文件中使用此选项

RewriteEngine On
RewriteRule \.html$ - [G]

只需将这一行添加到.htaccess文件中

RedirectMatch gone "/*\.html$"

完成,这是自动http头状态为410

只需将这一行添加到.htaccess文件中即可

RedirectMatch gone "/*\.html$"

完成,这是自动http头状态到410

不确定。得到500个错误。我正在使用你能给我完整的代码吗?@HelenM,因为你提到了。htaccess我假设某种Apache服务器。在这种情况下,您应该在尝试解决此问题时检查错误日志。不确定。得到500个错误。我正在使用你能给我完整的代码吗?@HelenM,因为你提到了。htaccess我假设某种Apache服务器。在这种情况下,您应该在尝试解决此问题时检查错误日志。