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

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.


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


You can create files that begin with a "." if you can view hidden files.

Enter the following commands to show hidden files:

defaults write com.apple.finder AppleShowAllFiles -bool YES
killall Finder

When you're done enter these commands to hide them again:

defaults write com.apple.finder AppleShowAllFiles -bool NO
killall Finder

You need to be able to see invisible files first.

In finder press ++. –command + shift + dot– to toggle hidden files visibility.

Then just go to the folder where the file is and you'll see it there. You can now rename the file to start with a . if you want.

To create a new file you can do this in the terminal: touch .htaccess, once the terminal is at the right folder


Use the terminal instead of Finder to rename it. Try mv.