How To Create And Use .htaccess Files For Apache Web Server in Microsoft Windows

H

Windows doesn’t support .htaccess files because of the naming convention. To Windows,.htaccess essentially is a nameless file, with a .htaccess file extension, similar in concept to having a file named .jpg. So you can see why file editors would complain if you try to save a file named .htaccess.

You can workaround this by 2 ways though:

Step 1: You can bring in the file, e.g. through FTP off a Linux box, and you can have it on your Windows computer and it wouldn’t complain. Apparently the complaints only come when you try to create a file named “.htaccess”.

Step 2: If you’re trying to run the Apache web server on Windows, then you’ll be glad to know that .htaccess is just a name, and the content inside your file is definitely still readable by Apache.

So even if .htaccess files can’t be created, you can reconfigure Apache by editing your Apache httpd.conf file so that maybe htaccess.txt are read by Apache instead of .htaccess. Just look for this line:

AccessFileName .htaccess

And change it to this line:

AccessFileName htaccess.txt

Voila. Problem solved.

Similar Posts:

About the author

Alvin Poh

I've over 17 years of entrepreneurship experience, having built a tech company to be the top in the country, which was subsequently acquired for an 8-figure sum. As CEO, I led the company through robust growth to 150 employees across 4 countries. After the acquisition, I embraced minimalism, sold off my personal possessions, and started living around the world.

Read more about my story here.

Add comment

By Alvin Poh

About Author

I've over 17 years of entrepreneurship experience, having built a tech company to be the top in the country, which was subsequently acquired for an 8-figure sum. As CEO, I led the company through robust growth to 150 employees across 4 countries. After the acquisition, I embraced minimalism, sold off my personal possessions, and started living around the world.

Read more about my story here.