How to create an htaccess file in Windows

Say you work developing websites locally, like I do, then perhaps at some point you have tried to create an .htaccess file to use on your web project. In this quick post I will show you how to create an htaccess file in Windows.

If you use Windows, then you know that it will complain if you try to name a file with a ‘dot’ at the beginning and with no file extension. So if you have tried, then you have met with the “You must type a file name” message staring back at you.

htaccess-file-rename-on-windows

You may be wondering how in the world can you create this type of file without having to copy it from your web host (say via ftp) anytime you need one.

Well wonder no more, I am here to tell you that you can create a brand new htaccess file in Windows and you can forget your ftp copying days.

Here are 3 simple steps to create a new .htaccess file in Windows:

1. Create a new text file by doing a right-click –> new.

create-new-text-file

2. Double click on the file to open it with your favorite default text editor. Do a ‘Save as‘.

htaccess-file-save-as

3. Name your file ‘.htaccess‘ and select All Files (*.*) in the Save as type field.

htaccess-file-creation-on-windows

Click Save and tadaa!

You got a mighty powerful .htaccess file at your command. An htaccess file is an essential part of your website’s security, so make sure you put him to work 🙂

create-htaccess-file-on-windows

To get the most out of your htaccess file and to see some of the cool things you can do with it check out htaccess tricks at Perishable Press.

Let me know if you have found another way to create this file in Windows on the comments below.

Hope this has helped.

Please Post Your Comments & Reviews

Your email address will not be published.

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.