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
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
You can add an alias in your startup script file to make the command shorter. Usually this is .bashrc, .bash_login or .profile file in your home directory.
alias ondot='defaults write com.apple.finder AppleShowAllFiles -bool YES; killall Finder'
alias ofdot='defaults write com.apple.finder AppleShowAllFiles -bool NO; killall Finder'
Now you can just type ondot
to show hidden files. and ofdot
for hiding hidden files