this is going to be a heavily geek-ified post, because i am frustrated and don’t have time to explain all of the stuff i already know about this…
there is this intensely useful text file on my web server that’s called .htaccess, which does things like control rewriting domains, and blocking undesirable IP addresses and stuff like that. i know it exists on my web server, because when i type
ls -a in the
public_html directory, it shows up there right at the top.
you’ve probably noticed by now that .htaccess is kind of an unusual name for a file: it doesn’t have a “file extension” like .pdf or .exe, except that – possibly – the entire file name is the “extension”, because it all appears after a period. on UNIX and linux machines, file names that start with a period indicate that they are “hidden” files, which means that they only show up if you go into the terminal, navigate to the directory where the files exist, and type
ls -a which means “list the current files in the directory, plus list all the files, whether they are hidden or not”
the problem i’m having is that i have a “working” copy of my web site, on my local computer, and when i’m “working” on that site, i have to save the document and then upload it to the “live” site, which is on my web server, currently in los angeles. the “working” copy is on my mac – which, fundamentally, runs a version of UNIX with a fancy GUI over the top. when i use the terminal to view the local site, i see the .htaccess file, but when i use the GUI and the application that i use to modify the web site, i do not see the .htaccess file, because it is a “hidden” file and i don’t see them with the GUI…
and – this is the important part – the only way i currently have to modify “hidden” files is to use
emacs or something like that, on the terminal RATHER than using the GUI and my code-authoring application.
currently, as far as i have been able to tell, there is no way to view “hidden” files like .htaccess on a mac, in the GUI at all: they don’t show up in the finder, they don’t show up in the application, and there’s no way to make them show up so that you can work on them like you would be able to work on .html files, or .php files…
if you happen to know how to make hidden files visible on a mac, i’d appreciate a comment.
also, within the past hour, i’ve received 6 spam messages at a time, about 4 times, with an identical subject line, and 10 more messages with the same subject line at spamcop. if i wouldn’t read it once, why does anybody bother sending multiple copies anyway? also, it looks like the beginnings of the spam-flood that happened on saturday… why me?? 🙁
2 thoughts on “.htaccess”
TRUE worked for me.
i’m not sure i would ever want to “turn it off”… i’m used to UNIX machines, where there are essentially no “hidden” files to begin with… just ones that it’s a good idea to know what you’re doing before you mess with them.
however, that only works in the Finder. in both of the code-authoring tools that i use (coda and bluefish) the hidden files are still hidden… of course i can drag-and-drop them from the finder, but it’s nothing like linux…
the terminal way:
Open Terminal, type this command, and press Enter:
defaults write com.apple.Finder AppleShowAllFiles YES
To make the command take effect, you need to restart the Finder. One way to do this is to hold down the Option key, then click and hold on the Finder icon in the Dock. When the contextual menu appears, select Relaunch and the Finder will restart.
NOTE: I found this tip twice, once using “YES” and once using “TRUE” at the end of the command. Don’t know which (if either) works since I’m downstairs at my netbook and my Mac is upstairs. Too lazy to do the trip.
Downside of this method is you have to go through the whole process again to turn it off (substitute “FALSE” or “NO”).
This is one point for Linux, where a ctrl-H toggles between showing/hiding the files or folders.
The application method:
Comments are closed.