我想要410个整个目录

我想要410个整个目录

本文介绍了我想要410个整个目录-我删除了博客的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站上有一个名为Blog的文件夹。
我将其全部删除。
我想要410。
如何对整个文件夹410进行压缩?

I had a folder called blog on my site.I deleted it all permanently.I would like to 410 it.How do i 410 an entire folder?

例如我的网站看起来像这样

e.g. my site looked like this

example.com/blog/mycoolpost1/
example.com/blog/mycoolpost2/
example.com/blog/mycoolpost3/
example.com/blog/mycoolpost4/

现在帖子1,2,3,4已死。

now posts 1,2,3,4, are dead.

所以我如何指定博客之后的所有内容都被永久删除。 (以及文件夹 blog本身)

so how do i specify that everything after blog, is permanently deleted. (as well as the folder 'blog' itself)

我需要这样的htaccess行...?

I need a htaccess line something like this...?

重定向410 / blog /?(.*)

redirect 410 /blog/?(.*)

推荐答案

是执行此操作的正确方法。您应该在虚拟主机配置中放入以下内容:

The Redirect directive is the proper way to do this. You should put the following in your virtual host configuration:

Redirect 410 /blog

如果您无权访问虚拟主机配置,则可以将其放入 .htaccess 文件放在文档根目录中,或者我相信您可以将以下内容放在博客中的 .htaccess 文件中子目录:

If you don't have access to the virtual host configuration, you can put it in the .htaccess file in your document root, or I believe you can put the following in the .htaccess file in the blog subdirectory:

Redirect 410 /

(我可能对此不太满意,我不确定 Redirect .htaccess中的路径解析之间如何精确交互文件)

(I might be off about that, I'm not sure how exactly Redirect interacts with path resolution in .htaccess files)

这篇关于我想要410个整个目录-我删除了博客的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 23:47