Mac OS X doesn't allow to name files starting with a dot. How do I name the .htaccess file?

Diego Favero picture Diego Favero · May 5, 2011 · Viewed 53.2k times · Source

As mentioned in the title, Mac OS X doesn't allow me to name files starting with a dot ( . ). But, I need an .htaccess file. Or, better, how do I use an htaccess file in Mac OS X without giving it a name starting with a dot?

I am running Mac OS 10.5.8 and XAMPP 1.7.3.

Answer

Matt Ball picture Matt Ball · May 5, 2011

You can't do this with the Finder. Open Terminal.app (Applications -> Utilities -> Terminal), and type:

> cd /path/to/directory/containing/htaccess
> mv current_file_name .htaccess

Example (do not take directory names or initial filename literally, of course):

terminal screenshot