如何使用 Windows 搜索 .htaccess 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1268390/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 12:59:03  来源:igfitidea点击:

How to search for a .htaccess file with Windows?

windowssearch.htaccesshidden

提问by Nona Urbiz

I am dealing with a massive nest of files and need to find a .htaccess file that is redirecting a single page in my website. I know how ridiculous this sounds: why not just check the directories the page is located within? But the problem is slightly more complicated than that. All I need though, is to search for every .htaccess file under the web folder. Trying a normal search doesn't allow me to select that type of file to search for, and searching for hidden files has just been (who knows why) ignoring the .htaccess files anyway. I can't download any new software to do this for me. but - there must be a way! Even if I could somehow list every file within a directory (and its subdirs) and then organize by file type and scroll down?

我正在处理大量文件,需要找到一个 .htaccess 文件来重定向我网站中的单个页面。我知道这听起来多么荒谬:为什么不检查页面所在的目录?但问题比这稍微复杂一些。我所需要的只是搜索 web 文件夹下的每个 .htaccess 文件。尝试普通搜索不允许我选择要搜索的文件类型,并且搜索隐藏文件一直(谁知道为什么)忽略 .htaccess 文件。我无法下载任何新软件来为我执行此操作。但是——一定有办法!即使我可以以某种方式列出目录(及其子目录)中的每个文件,然后按文件类型组织并向下滚动?

I could search for any file with the word "RewriteEngine" , but there are so many files, this would take forever.

我可以搜索任何带有 "RewriteEngine" 一词的文件,但是文件太多了,这将花费很长时间。

Any ideas?

有任何想法吗?

Thanks!

谢谢!

=/ notepad++ is not installed, and I don't have auth to install anything

=/记事本++没有安装,我没有安装任何东西的授权

回答by Alexander Egger

Use the commandline.

使用命令行。

findstr /s RewriteEngine .htaccess

Searches the current directory and all sub directories for .htaccess files containing the string RewriteEngine.

在当前目录和所有子目录中搜索包含字符串 RewriteEngine 的 .htaccess 文件。

回答by Dmitry Brant

Try searching for files of the form: *htaccess

尝试搜索以下形式的文件: *htaccess

(spelled precisely like that in the search field)

(与搜索字段中的拼写完全相同)

回答by Anthony Shaw

have you tried using Notepad++. It has a 'Find in files...' option that you could specify the page that it's trying to redirect to, and you could have it check only in *.htaccess files.

您是否尝试过使用 Notepad++。它有一个“在文件中查找...”选项,您可以指定它尝试重定向到的页面,并且您可以只在 *.htaccess 文件中检查它。

Just a thought

只是一个想法

回答by Nosrama

Search All files and folders, in All or part of the filename: put ".htaccess" including the quotes.

全部或部分文件名中搜索所有文件和文件夹:放置“.htaccess”,包括引号。

回答by Cornbeetle

in the command prompt:

在命令提示符中:

for hidden files: dir /s /b /a:sh *.htaccess>C:\results.txt

对于隐藏文件:dir /s /b /a:sh *.htaccess>C:\results.txt

for non-hidden files: dir /s /b *.htaccess>C:\results.txt

对于非隐藏文件:dir /s /b *.htaccess>C:\results.txt

to search for "RewriteEngine" type dir /s /b rewriteengine

搜索“RewriteEngine”类型 dir /s /b rewriteengine

both of these will output the search results to a text file called "results"

这两个都会将搜索结果输出到一个名为“results”的文本文件中