PDA

View Full Version : .htaccess file


Jason
2006-06-03, 05:48
Well, I think I may have spoilt my Mac.

I run a Wordpress site and made a backup of the files. However, when It came to downloading my .htaccess file, my FTP manager said that the file already existed and did I want to overwrite it.
At first, I said no and ran a search for it with Spotlight but it came up with nothing. I really needed a copy so I went ahead and downloaded it.
I haven't noticed anything odd yet but I'm worried I may have overwritten a file on the actual OS of my Powerbook.
I was under the impression that an .htaccess file on my server was not the same as a file in Mac OSX.

http://www.jasonnewton.net/download_error.png

As you can see, I am really confused. Where is this file stored on my Powerbook and have I caused any damage?

spikeh
2006-06-03, 05:57
I wouldn't have thought you have. The .htaccess file is used to configure permissions and directives for Apache, which is probably the webserver Wordpress runs on - unless you have Apache installed and running on your Powerbook, don't worry about it.

Jason
2006-06-03, 06:05
I have a bunch of files (that relate to Apache mostly html ones in the Library/Services folder but I've never really looked at them.
I'm just curious why my download manager says there is a file on my HD called '.htaccess' but I cannot see it.

spikeh
2006-06-03, 06:11
Possibly a hidden file? That's the only conclusion I can come to.

Bryson
2006-06-03, 06:13
I thought all files with a leading full stop (or a period, Americans...) were hidden.

staph
2006-06-03, 06:20
I thought all files with a leading full stop (or a period, Americans...) were hidden.

Bingo.

At any rate, the .htaccess file almost certainly doesn't contain anything crucial. It's just a collection of per-directory overrides from the main server settings in /etc/httpd/httpd.conf.

For more on what .htaccess files are and what you can do with them, see here (http://httpd.apache.org/docs/1.3/howto/htaccess.html).

Jason
2006-06-03, 07:22
What if the permissions were different on the one I downloaded (they are 644).

This .htaccess file from my Wordpress site would have overwritten the one on Mac OSX wouldn't it?

Wouldn't the permissions now be screwed on my OS?

I just need a litle reassurance as I don't know anything about Terminal, Unix etc.

But thanks for the help so far.

:)

v.noir
2006-06-03, 07:58
It would appear that the permissions of your local .htaccess file don't really matter - unless you have an Apache server running on your Mac. If you don't, then I doubt Mac OS X would even look at that file at all.

staph
2006-06-03, 08:45
Possibly. With 644 (i.e. rw-r--r--) permissions, the web server should be able to read the file, so I really don't think it will be a problem.

ghoti
2006-06-03, 09:53
Even if you have Apache on your Mac, if you're just backing data up into a directory somewhere, you can overwrite whatever .htaccess file there might be. If you backed it up into your Sites directroy or something similar, there might already be a file there. So just create a different directory and you should be fine.

Jason
2006-06-03, 15:28
Thanks guys.

You were all really helpful.

:)