Introduction to the method of creating. htaccess files in Windows

Source: Internet
Author: User

Here are a few ways to:

1, the use of DOS commands, in DOS There are three ways to choose:

Use screen Editing command copy con. htaccess, enter the content, and finally press Ctrl+z end Edit, the successful generation. htaccess;
Using the rename command ren 1.txt. htaccess, this is the most common method, in Windows window can not be executed under the command, under CMD but Luliping;
Use the redirect command echo. >.htaccess, you can also create success by entering a carriage return character into the. htaccess.


2, with the WinRAR file Manager, the first new article document, and then open the WinRAR main interface, to locate the file, you can directly rename, this is I in the decompression of a foreign open source project, With its own. Htaccess actually can extract the correct, the inspiration, of course, you use 7zip and so on Manager is also OK.


3, directly through the text editing tools to save, such as Notepad, UltraEdit, etc., but save the time to select all the files on it, this is really a way to beat.

4, use the file creation method in PHP, fopen,file_put_contents file name directly take. htaccess.


5. Save the following code as a. bat file and drag any file onto the file icon to remove the filename and retain only the suffix.

The code is as follows Copy Code
@ren "%~f1". *

is to invoke the Cmd.exe ren (rename) command:
1, @ represents the display of the hidden command itself
2, the first parameter is the source file path containing the file name and suffix
3, the second parameter meaning is to retain the file name and suffix of the first point and later parts. So the 2L answer is problematic, and it will rename A.a.txt to. a.txt instead of. txt

The correction is as follows (where the second parameter is the suffix):

  code is as follows copy code
@ren "%~f1" "~ X1 "
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.