In windows, we know that you cannot create a file without a main file name. If you want to create a file in windows. for the htaccess file, we have to find other methods. I will summarize them below. htaccess creation methods.
The following methods:
1. There are three methods to use the DOS command:
Use the Screen Editing Command copy con. htaccess, press enter, enter the content, and press ctrl + z to complete the editing. htaccess is successfully generated;
RENAME Command ren 1.txt. htaccess. This is the most common method. commands that cannot be executed in windows are flushed in cmd;
Use the redirection command echo.>. htaccess. Enter a carriage return to. htaccess, which can be created successfully.
2. Use winrar's file manager to create a new text document, open the winrar main interface, locate the file, and rename it directly. This is when I decompress a foreign open-source project, its own. when htaccess can be decompressed correctly, you can use a manager such as 7zip.
3. Save the file directly by using a text editing tool, such as Notepad and ultraEdit. However, you can select all files when saving the file. This is really an outstanding method.
4. Use the file creation method in php, fopen and file_put_contents file names can be obtained directly using. htaccess.
5. Save the following code as a. bat file. Drag any file to this file icon to remove the file name and retain only the suffix.
The Code is as follows: |
Copy code |
@ Ren "% ~ F1 ".* |
Rename the RENAME command of cmd.exe:
1. @ indicates hiding the display of the command itself
2. The first parameter is the path of the source file containing the file name and suffix.
3. The second parameter indicates that the first vertex and subsequent parts of the file name and suffix are retained. If 2l's answer is a question, a.txt will be renamed as .a.txt but not. txt.
The modification is as follows (the second parameter is the suffix ):
The Code is as follows: |
Copy code |
@ Ren "% ~ F1 "" % ~ X1"
|