Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-20-2004, 03:08 PM   PM User | #1
finsklapphundkl
New to the CF scene

 
Join Date: Oct 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
finsklapphundkl is an unknown quantity at this point
Protecting a *.doc with htaccess

Hello

At my webhost Ive made a folder containing some *.xls and *.doc
These files is supposed to be accessed only by me and a few others.

Ive placed a htaccess-file in the folder. The folder itselves is protected, and so is som html-files. But!!! if i type the url to the *.doc directly in my webbrowser, the *.doc opens......

Why?

Thanks in advance!
Rug

Last edited by finsklapphundkl; 12-20-2004 at 03:18 PM..
finsklapphundkl is offline   Reply With Quote
Old 12-22-2004, 08:57 AM   PM User | #2
finsklapphundkl
New to the CF scene

 
Join Date: Oct 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
finsklapphundkl is an unknown quantity at this point
Solved!!

Not much help here......(

But I solved the problem:
I made a new folder under the documentfolder,
(Like http://www.myhomepage.com/documents/members/members.doc), but lets the htaccess-file stay in the documentsfolder.

In this way the folder members gets protected, and hence the members.doc

Rug
finsklapphundkl is offline   Reply With Quote
Old 12-26-2004, 05:50 PM   PM User | #3
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
The easiest way would have been to place your files above your root web directory making it non-accessible to the public.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 01-07-2005, 10:33 AM   PM User | #4
finsklapphundkl
New to the CF scene

 
Join Date: Oct 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
finsklapphundkl is an unknown quantity at this point
Maybe

But I try to have as few files ad possible in the root. My page is growing, and if I dont watch out, I might loose my "overview" of what files belonging where.....

)
finsklapphundkl is offline   Reply With Quote
Old 01-07-2005, 02:50 PM   PM User | #5
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Quote:
Originally Posted by finsklapphundkl
But I try to have as few files ad possible in the root. My page is growing, and if I dont watch out, I might loose my "overview" of what files belonging where.....

)
It is common practice to place any files you don't want accessible to the public that need to be accessible for site functionality in a non-web-accessible directory. Thus you create a directory just above the public_html, www, etc whatever the root web directory is being used for your server. This makes the files non-accessible to the public but still makes them accessible to the site using relative paths. That is how you would do it if you were using .htaccess and needed to use a .htpasswd file. The .htpasswd file obviously needs to be in a non-web-accessible directory but yet still be accessible to the .htaccess file. Same goes with include files for various different web based scripting languages. You would place the include directory above your web root directory.

Edit: I just reread your original post again. I didn't notice you said you wanted it to be accessible to other members. In that case then it would be best to place the files in a web accessible directory and just use a .htaccess file in combination with a .htpasswd file and just give each of the members a login to access the directory. If you were able to type the URL directly and still access the file then that means your .htaccess and/or .htpasswd was not setup correctly.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!

Last edited by Spookster; 01-07-2005 at 02:54 PM..
Spookster is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:14 AM.


Advertisement
Log in to turn off these ads.