Accessing The Site Folder protected by .htaccess

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stonecold
Forum Newbie
Posts: 2
Joined: Thu Feb 24, 2005 8:00 am

Accessing The Site Folder protected by .htaccess

Post by stonecold »

Accessing The Site Folder protected by .htaccess

When I try to access a site folder which has been protected by .htaccess the browser will pop up a standard username/password dialog box.

Is there a way which allow to embed a username/password box in a website to do the authentication.

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

remove the .htaccess file, place code in all scripts such that when a "new" user will be required to enter username and password. This is most often done with sessions and marking a user as logged in.
stonecold
Forum Newbie
Posts: 2
Joined: Thu Feb 24, 2005 8:00 am

Post by stonecold »

But the files in the folder should be protected. Anyone can view those files without the .htaccess protection.

I want a way so that instead of browser login box, i can get the user verification done through my own login box.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't believe that's possible the way you have detailed.

You can place the actual folder outside the browsable space and use a script to pass the files to a client, or redirect all requests through a page (mod_rewrite) ...
Post Reply