PDA

View Full Version : .htaccess Generator complications



GirlyGeekMN
06-22-2008, 09:48 PM
1) Script Title: .htaccess Password Generator

2) Script URL (on DD): http://tools.dynamicdrive.com/password/

3) Describe problem:
It seems to me I've done everything right...but I'm very new at this, so be gentle with me...
I'm using FrontPage, and I generated the files step by step. I want it to block the WHOLE site, so I left Step 3 blank (is that my problem?). Then I created the files in Notepad, left them titled ".htaccess" and ".htpasswd" (no, there is no .txt after them, I checked). I placed them in the folder I want protected (which covers the whole site), but when I published the site, nothing happened. Ideas for what I did wrong?

jscheuer1
06-23-2008, 12:37 AM
Aside from any minor or major issues as regards following the directions is concerned - from what you say, I think you got at least the broad strokes right - FP (if that is the agent you are using to upload the files) will often alter files without informing you before uploading them. Also, none of this will work if your server isn't .htaccess capable and enabled for your domain. You can find out about that by reading your host's documentation, or by asking them.

GirlyGeekMN
06-23-2008, 01:26 AM
Hmm, I guess I just assumed it was accepted my host. It should be, but I'm e-mailing them to confirm that.
What do you mean by FP altering files without telling me?
Thanks, by the way :)

traq
06-23-2008, 02:15 AM
it means exactly that: FrontPage will rewrite your code when it includes something that Microsoft decided is written wrong, or that they just don't like.

after you save your work, re-check your code to make sure it hasn't changed. if you can't get FP to leave it alone, then copy the whole bit (in html view) and paste it into notepad and save your webpage that way.

jscheuer1
06-23-2008, 05:37 AM
What do you mean by FP altering files without telling me?


it means exactly that: FrontPage will rewrite your code when it includes something that Microsoft decided is written wrong, or that they just don't like.

Yep, it's worse than that though. Say you write your code in a text only editor and are only using FP to publish it. It will rewrite - overwrite it before publishing.

There's a way, with HTML at least, to prevent this (webbot comment tags). But for other types of files, I'm not sure. There may be ways in FP's own configuration to change this behavior. I don't know because I gave up on using it long ago for this and several other reasons.

traq
06-23-2008, 02:41 PM
...There may be ways in FP's own configuration to change this behavior.

You can go to Tools > Page Options, go to the HTML Source tag, and check the box that says "Preserve existing HTML." Then go to the Compatibility tag and uncheck the box that says "Enabled with Microsoft FrontPage Extensions."

This will solve most, but not all, of your FP-related problems. Unfortunately (if you happen to like them) you won't be able to use FP Server Extensions -stuff like the automatic nav menus, forms, custom header and footers, etc. But there are ways to make all those things without using FP, and once you figure them out, you'll be better off anyway. :)

GirlyGeekMN
06-24-2008, 08:30 PM
I knew it did some weird stuff with my code. But I didn't know that if I edited it in Notepad, it could change it on me again! Thanks, and now I'm going to go under Tools>Options and try to fix that
...
By the way, might using frames be a problem?

jscheuer1
06-24-2008, 08:48 PM
I knew it did some weird stuff with my code. But I didn't know that if I edited it in Notepad, it could change it on me again! Thanks, and now I'm going to go under Tools>Options and try to fix that

It can and often will change things, all that is required for that is that you open, view, do whatever with the file in FP after you've edited it in any other editor.

And what traq mentioned as a fix for this, he/she also mentioned that it will not always work. If you want to be able to upload files to your server without worrying about this at all, get a separate FTP file upload program (if your host allows its use - most do. Or use your host's live upload interface, if they have one).


By the way, might using frames be a problem?

Probably not as far as .htaccess goes. It operates on files and/or directories. However, if the problem is that nothing will display in the browser even after giving the correct password, or nothing displays in the browser and there is no opportunity to give a password, it might. What exactly is the issue here?

GirlyGeekMN
06-25-2008, 12:46 AM
Here's the problem:
The file goes into FP and then disappears off the file list. So I try uploading it and go to a page the .htaccess should cover. Nothing happens. But interestingly, I typed in the address the .htaccess should be at, and there it was (well, it said "Forbidden," but that means it must be published to the web). At this point, I think I'm just gonna blame it on frames.

traq
06-25-2008, 07:45 AM
traq...he/she

...he :)


Here's the problem:
The file goes into FP and then disappears off the file list. So I try uploading it and go to a page the .htaccess should cover. Nothing happens. But interestingly, I typed in the address the .htaccess should be at, and there it was (well, it said "Forbidden," but that means it must be published to the web). At this point, I think I'm just gonna blame it on frames.

well, try uploading it with FTP and see if the same thing happens. make a test page without frames and see what happens. that'll tell you where the problem lies, anyway.

jscheuer1
06-25-2008, 11:53 AM
Define 'nothing'. Do you mean that the page loads normally without any request that you log in with your username and password? If that's what's happening, .htaccess and .htpasswd are not doing their job. You did create both files and upload them, right? If you mean that you get nothing, no prompt for password and no page, it means you did .htaccess mostly right, but that .htpasswd isn't where .htaccess expects it to be.

GirlyGeekMN
06-25-2008, 02:20 PM
traq:
That sounds like a great idea. Do I need to download some software for FTP, or do I just follow some steps to upload it? (A link to a tutorial would be nice).
You people make things seem so obvious, in a good way.
well, try uploading it with FTP and see if the same thing happens. make a test page without frames and see what happens. that'll tell you where the problem lies, anyway.

jscheuer1:
I get exactly what you described first. There is no prompt for passwords, but the page loads just fine. This is what .htaccess says:

AuthName "Restricted Area"
AuthType Basic
AuthUserFile http://www.oakparkfarm.com/sweetie/.htpasswd
AuthGroupFile /dev/null
require valid-user

And this is what .htpasswd says:

kel:BuuILpl4mudJo
administrator:RagQn78KH88J.

And this is where I installed them in FP:
http://i200.photobucket.com/albums/aa11/GirlyGeekMN/helpme.jpg
Right after I placed them in that folder, they disappeared.


Totally off topic here, but how can I "thank" you people? Is there a button I press somewhere. I don't know if I said this before but...uh...I'm a noob/newb, sad to say.

*Edit: Nevermind I found the button* =D

traq
06-25-2008, 02:55 PM
your server almost certainly has some sort of FTP software you can use. email them to find out. if they don't someone can recommend a FTP program (I've always used internet explorer, out of convenience, just log on to the ftp address and drag and drop).

and not to put a damper on your .htaccess adventures, but your server may also already have some form of password protection system set up for you (I use 1and1, and you can automatically create .htaccess passwords right from their admin panel)...:)

jscheuer1
06-25-2008, 06:50 PM
The disappearing file thing, that would seem to suggest a lack of support for this on your host's part. However, it may just be an issue with FP. As long as you are going to ask them about password protection, might as well ask them if .htaccess, etc, are supported/allowed with your account.

GirlyGeekMN
06-26-2008, 04:31 PM
traq:
Trust me, these ".htaccess adventures" have already been "dampered." I'm sure if I actually knew what I was doing...that might help. Anyways...
If you can do FTP with Internet Explorer by "dragging and dropping," I suppose it can't be toooooo hard....Actually, I'd rather just ask if they have a password program for me.
jscheuer1:
I'm one step ahead of you. I asked them if .htaccess/.htpasswd was supported and, yes, it is.

Well, it turns out my host DOES have a password protect system...and I went through ALL this trouble...Well, thanks you two for sticking here this whole time! :D