htaccess and how it works

djcronos

Verified User
Joined
Mar 21, 2006
Messages
75
Hi all,

I have a customer who wants to understand the .htaccess a little more. Basically, he wants to make sure he can add more items to the .htaccess file after adding stuff via DA's Password Protected Directories link.

Is this possible?

Thanks in advance.
 
The short answer is YES

Coincidentally, I tripped over this same problem just today. I am use to using .htaccess for for a LOT more things that just password protection and this DA method leaves much to be desired in term of providing the "correct" .htaccess behavior.

The '.' is suppose to mean that this is a hidden file and in the unix world it is and windows doesn't like it either if you try to edit it and probably your ftp client won't be able to "see" them either BUT the DA file manager happily not only can see them but will allow you to edit the files as well. NO PROBLEMO! Check it out.

hope this helps, mikesz allaboutdatingsites
 
Wow! An entire book on one apache module.

Who said that Open Source isn't documented well enough :).

iworx, does your link contain a referral code?

If so please disclose that; some of us like a friend of ours to get paid when we buy books from amazon.

:)

Thanks!

Jeff
 
Thanks for all the replies, but I don't have a question on mod_rewrite or .htaccess, I have more of a question about how DA interacts with that .htaccess file.

For example, if I'm using the DA control panel to password protect a directory, should I do that before or after I edit the .htaccess file manually via the CLI? If I edit it before password protecting that directory through the DA control panel, will DA overwrite the .htaccess file once I protect that directory where the .htaccess file is located?
 
DA and .htaccess

I am pretty new to DA so I don't know the nuts and bolts answer about how DA interacts with an .htaccess but in testing, if you don't have a .htaccess file in a folder you want to password protect then DA creates one for you when you use the password protect function. If you DO have a .htaccess file, it appends the password protection code to the existing file. So, either way, once you have the .htaccess file, you can edit it in the DA file manager. For example, in my case where I have an IP ban list, I can easily add or remove the IP addresses from the list without disturbing the password protection code.

hope this helps,

Mikes, allaboutdatingsites
 
jlasman said:
iworx, does your link contain a referral code?

Nope, I just copied/pasted the url from amazon.

It's a great book and the author deserves the attention.
 
djcronos said:
Thanks for all the replies, but I don't have a question on mod_rewrite or .htaccess, I have more of a question about how DA interacts with that .htaccess file.

For example, if I'm using the DA control panel to password protect a directory, should I do that before or after I edit the .htaccess file manually via the CLI? If I edit it before password protecting that directory through the DA control panel, will DA overwrite the .htaccess file once I protect that directory where the .htaccess file is located?

There is only one way to find out -- test it :D

Ok and so I did:

1) Pasword protect a directory:
- .htaccess gets created
- I added some rewrite lines at the bottom.
- Removed pasword protection with DA
- My rewrite lines disappeared, pasword protection still in place.

2) Create a htaccess file with Rewriterules
- Save file
- Pasword protect directory
- Rewriterules get overwritten, only RewriteEngine On stays in place.

So, DA doesn't work well with .htaccess - or, you write your htaccess yourself or you let DA take care of it. But don't combine both.
 
Back
Top