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

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