.htaccess
Posted by: jzm (---.dsl.dyn.ihug.co.nz)
Date: March 11, 2008 04:42AM

What do i need to put in the doc so when I access my wamp ip address I have to login to access wamp

Options: ReplyQuote
Re: .htaccess
Posted by: yfastud (Moderator)
Date: March 11, 2008 04:50AM


Options: ReplyQuote
Re: .htaccess
Posted by: jzm (---.dsl.dyn.ihug.co.nz)
Date: March 11, 2008 04:52AM

what should I put in the .htaccess

Options: ReplyQuote
Re: .htaccess
Posted by: yfastud (Moderator)
Date: March 11, 2008 05:09AM

Code for file .htaccess
AuthName "Private Areas"
AuthType Basic
AuthUserFile c:/full/path/to/.htpasswd
Require valid-user

Code for file .htpasswd
user:pass

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: .htaccess
Posted by: jzm (---.dsl.dyn.ihug.co.nz)
Date: March 11, 2008 05:12AM

Thanks

Options: ReplyQuote
Re: .htaccess
Posted by: jzm (---.dsl.dyn.ihug.co.nz)
Date: March 11, 2008 05:19AM

I have now got:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

How do I fix this

Options: ReplyQuote
Re: .htaccess
Posted by: yfastud (Moderator)
Date: March 11, 2008 05:19AM


Options: ReplyQuote
Re: .htaccess
Posted by: yfastud (Moderator)
Date: March 11, 2008 05:22AM

Make sure you have to put in the full path here:

c:/full/path/to/.htpasswd

For example, if stored .htpasswd file in c:/wamp/www, then this code should be c:/wamp/www/.htpasswd

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: .htaccess
Posted by: jzm (---.dsl.dyn.ihug.co.nz)
Date: March 11, 2008 05:25AM

heres my .htaccess file

AuthName "JZM Wamp Server"
AuthType Basic
AuthUserFile c:\wamp\www\ht.passwd
Require valid-user

still getting 500

Options: ReplyQuote
Re: .htaccess
Posted by: yfastud (Moderator)
Date: March 11, 2008 05:29AM

It's wrong, you must use forward flash, not backward flash

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: .htaccess
Posted by: psn (---.tbcn.telia.com)
Date: March 19, 2008 09:46PM

A question for this htaccess, is it possible to only get this part working for the index.php file and not for other dir in the www folder? I tried this and put both files in the www folder and its working for the index but I don't won't this to have any affect on my other folders in the www dir.

Any suggestion to solve this?

EDIT: What I understand when I have read more its not possible to add in just for the index as all other dir also will be protected. I think I can solve this to create a login via php and rename the index to other name.

Regards/Per



Edited 1 time(s). Last edit at 03/19/2008 11:13PM by psn.

Options: ReplyQuote
Re: .htaccess
Posted by: yfastud (Moderator)
Date: March 20, 2008 12:33AM

Or you can setup Virtual Hosts and use different name instead localhost and put your www in the last VH, so when users access your site by ip, they will go to the first vh or not found if trying localhost

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: .htaccess
Posted by: psn (---.tbcn.telia.com)
Date: March 20, 2008 01:40AM

Case solved with a php login and logout script + rename the index file

Regards/Per

Options: ReplyQuote
Re: .htaccess
Posted by: barrycarlyon (---.leeds.ac.uk)
Date: May 19, 2008 10:39AM

Pusuant to this,

I have a correct .htaccess, the path to my .htpasswd is correct, and i have valid user:pass combo, as generated at [tools.dynamicdrive.com] using the .htpasswd password generator

However I keep getting user:password mismatch showing in the error log, so I bounced this to my proper website, and it works fine, so there is something wrong with the wampserver interpretation of .htpasswd?

Options: ReplyQuote
Re: .htaccess
Posted by: barrycarlyon (---.leeds.ac.uk)
Date: May 19, 2008 10:41AM

Um ok just had a thought, there would appear to be a problem as wampserver only takes passwords not encrypted like:

baznet:cake
bcarlyon:u5a2YqULmUX/M

baznet works, bcarlyon does not.....

I might have missed something in the httpd.conf but I doubt it, why does wamp only read in the clear passwords and not encrpted ones?

Options: ReplyQuote
Re: .htaccess
Posted by: yfastud (Moderator)
Date: May 19, 2008 03:49PM

That encryption is for *nix, use MD5 for windows

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: .htaccess
Posted by: barrycarlyon (---.leeds.ac.uk)
Date: May 19, 2008 05:26PM

the problem being baznet cake combo works.
no md5 needed.....

Options: ReplyQuote
Re: .htaccess
Posted by: yfastud (Moderator)
Date: May 20, 2008 05:34AM

He he.... he he... ;-)
I knew that standard user and pass will always work on Windows, but if you want to use encryption in Windows, use MD5. I hope I make it clear this time ;-)

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: .htaccess
Posted by: kleelof (183.88.120.---)
Date: March 27, 2010 08:29AM

Hello,

Anyone know the .htaccess configuration to prevent entry, but not password protect. Every example I can find has to do with password protecting, but I want to create an area that will not allow people to access it with something like [www.mysite.com].

take care,
lee

Options: ReplyQuote
Re: .htaccess
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: March 27, 2010 11:35AM

To prevent access to a directory place a .htaccess in the directory you want to prevent access to and add the following commands
Order allow,deny
deny from all
NOTE: This will also prevent access to all files/folders within the directory too.

Options: ReplyQuote


Sorry, only registered users may post in this forum.