我想手动创建一个.htaccess
文件,但通过Windows UI发现这似乎是不可能的。我收到一条“您必须键入文件名。”消息。必须有一种方法来使用<code>创建文件作为Windows中的前缀。
这可以手动完成吗?
我想手动创建一个.htaccess
文件,但通过Windows UI发现这似乎是不可能的。我收到一条“您必须键入文件名。”消息。必须有一种方法来使用<code>创建文件作为Windows中的前缀。
这可以手动完成吗?
如果启动“记事本”,然后启动“文件”->;另存为->;写.htaccess并选择“所有文件”作为类型-然后它将为您创建.htaccess文件。
在记事本中选择文件>另存为…
文件名:“随心所欲”
(带前导点)
您可以在资源管理器(Windows 7)中通过在文件名末尾添加句点来完成此操作:
。随心所欲代码>
验证时,Windows将自动删除尾随点。
转到命令提示符,cd到相应的文件夹,然后键入:
notepad .htaccess
After confirmation dialog the file will be created and you will be editing it directly. If you just want to create an empty file, try
echo. > .htaccess
您也可以将命令提示符与move
一起使用:move x.extension
您可以在Explorer
以外的任何程序中执行此操作,例如Notepad
、cmd.exe
等。
您在Explorer中无法做到这一点,Raymond Chen提供了为什么不解释。
只需键入<code>.htaccess。</code>作为文件名即可。注意htaccess末尾的点。这将在Windows中更改为.htaccess
,末尾不带点。
即使您没有任何第三方编辑器(Notepad++等),也可以创建以句点为前缀的文件。
要创建.htaccess
文件,请首先使用上下文菜单>;创建htaccess.txt文件;新建文本文档
。
然后按Alt+D
(Windows 7)和Ctrl+C
从Windows资源管理器的地址栏复制路径。
然后转到命令行,键入如下代码以重命名文件:
rename C:path ohtaccess.txt .htaccess
现在您有了一个空白的.htaccess
,而无需在任何编辑器中打开它。
希望这能帮到你
您可以使用另存为对话框使用“.something”保存它。
听起来可能不太合适,但Windows 1903最终允许在资源管理器中用前导点命名文件:-)
在Windows中,只需使用cmd转到文件夹,然后键入以下命令:
DIR>.htaccess
This command will create a .htaccess
file and will dump some data in it.
Remove the data, and it can be used as .htaccess
file.
看来微软终于解决了这个问题。Explorer的Insider Edition中的当前版本允许创建前面有点的文件。
使用Build 19541进行测试
如果你使用Git并安装了Git Bash,你可以在目录中打开Git Bassh(通过在Explorer>;Git Bash-Here中的空白处单击鼠标右键),然后执行:
touch .htaccess
作为补充,如果有Sublime Text安装在您的开发计算机中,您可以将文件拖动到打开的Sublime文本窗口,右键单击文件名->;重命名并输入任何名称,即使没有任何扩展名。这对我很有效。
您可以使用<code>echo>。gitignore。这就是我创建<code>的方法。gitignore
C:Usersjaimemontoya[path]>dir
Volume in drive C is OS
Volume Serial Number is 2BD2-JQ68
Directory of C:Usersjaimejaimemontoya[path]
11/02/2021 02:42 AM <DIR> .
11/02/2021 02:42 AM <DIR> ..
11/05/2021 05:22 AM <DIR> .git
11/02/2021 02:41 AM <DIR> .gradle
11/02/2021 02:43 AM <DIR> .idea
11/02/2021 02:41 AM <DIR> app
11/02/2021 02:41 AM <DIR> build
..........
..........
12 File(s) 14,104 bytes
8 Dir(s) 231,501,361,152 bytes free
C:Usersjaimemontoya[path]>echo. > .gitignore
C:Usersjaimemontoya[path]>dir
Volume in drive C is OS
Volume Serial Number is 2BD2-JQ68
Directory of C:Usersjaimemontoya[path]
11/05/2021 05:40 AM <DIR> .
11/05/2021 05:40 AM <DIR> ..
11/05/2021 05:22 AM <DIR> .git
11/05/2021 05:40 AM 3 .gitignore
11/02/2021 02:41 AM <DIR> .gradle
11/02/2021 02:43 AM <DIR> .idea
11/02/2021 02:41 AM <DIR> app
11/02/2021 02:41 AM <DIR> build
..........
..........
13 File(s) 14,107 bytes
8 Dir(s) 231,512,551,424 bytes free
在windows中,还可以使用cmd创建这些类型的文件。
mkdir .htacess
请验证此文件是否已创建。
I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...
Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...
I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...
How can I create an empty file at the DOS/Windows command-line? I tried: copy nul > file.txt But it always displays that a file was copied. Is there another method in the standard cmd? It should ...
I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...
My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...
Yes, I know, the archive bit is evil. That being said, is there support for querying it with find , and modifying it with chmod ? My googling has turned up nothing......
I built a Java application that is delivered on USB sticks. To ensure compatibility, I ship an appropriate JVM on the sticks. I made an EXE that simply invokes this JVM with the application jar. Now ...