n ways to freely create. htaccess files under Windows

Source: Internet
Author: User


. htaccess is an Apache access control file, Apache httpd.conf options with this file, the perfect implementation of the directory, site access control, of course, the most or rewrite function, that is, url rewrite, PHP implementation of pseudo-static an important way, is also recognized as SEO in search engine friendly is a very effective means.
Although the previous days of the black screen storm uproar, but according to my humble opinion, Windows users did not reduce any. One practical problem now is that Windows does not allow renaming. There are no characters in front of it, and it is considered illegal to have such a file name. This makes it impossible for us to create this access control file by renaming "new text document. txt" to ". htaccess", but there is always a workaround. And look at the following several methods:

1, the use of DOS command, under DOS There are three ways to choose:

Use the On-screen edit command to copy con. htaccess, enter the content, and finally press CTRL + Z to end the edit, the successful generation. htaccess;
Use the rename command ren 1.txt. htaccess, this is the most conventional method, in Windows window can not execute the command, under the cmd but hushed;
Use the redirect command echo. >.htaccess, where a carriage return is entered into the. htaccess, it is also possible to create a success;
Three methods are as follows:


2, with WinRAR file Manager, first create a new article document, and then open the WinRAR main interface, navigate to the file, you can rename directly, this is when I unzip a foreign open source project, Its own. Htaccess can actually extract the right out of the inspiration, of course, you use 7zip and the like manager is also possible, OK, see:


3, directly through the text editing tools to save, such as Notepad, UltraEdit and so on, but save the time to choose all the files on it, this is really a way to beat, but certainly not I owe beating, is not to beat the Microsoft, gorgeous to a:


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

I have found it at present (invention?) There are so many ways, but should it suffice?

n ways to freely create. htaccess files under Windows

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.