This is a discussion on Can't get .htaccess to work on Apache under Windows XP within the Windows Web Servers forums, part of the Web Server and Related Forums category; Greetings, I can't seem to get .htaccess to work on Apache2+ under WinXP Pro. First I installed and configured ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Greetings,
I can't seem to get .htaccess to work on Apache2+ under WinXP Pro. First I installed and configured Apache and got everything configured and working properly (nothing's live yet just working off of localhost). Then I created the two files, .htaccess and .htpasswd, using the htpasswd.exe application that comes with Apache (I had to do it this way becuase you can't create a file with a nameless extension on the desktop). Finally I created two new filetypes for .htpasswd and .htaccess so I could open them in notepad. The .htpasswd contains a single user (md5 encrypted) and looks like this: stone:$apr1$e50.....$szuwghDBUK3q5SBK6gkAM. The .htaccess file resides within the subdirectory I want to password protect and looks like this: AuthUserFile D:\Program Files\Apache Group\Apache2\.htpasswd AuthType Basic AuthName "Member Page" require valid-user All relevant lines in the httpd.cnfg file are: AccessFileName .htaccess <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> Apache does its job when I attempt to view the .htaccess file I get a Permission Denied message. But when I browse to the protected directory where my .htaccess file resides my browser displays the index page rather than prompting me for a password. What am I doing wrong? Thanks, Kevin Stone |
|
|||
|
make sure u have the AllowOverride directive set.
Go to the subdir u want to protect in your conf file and type AllowOverride AuthConfig i.e. to use .htaccess files in the dir called access you would need this in your conf file. <Directory "C:\Program Files\Apache Group\Apache2\htdocs\access"> Options +Indexes AllowOverride AuthConfig </Directory> hope this helps Robin "Kevin" <kevinstone3387@hotmail.com> wrote in message news:66f77f3a.0402262318.138b6055@posting.google.c om... > Greetings, > > I can't seem to get .htaccess to work on Apache2+ under WinXP Pro. > First I installed and configured Apache and got everything configured > and working properly (nothing's live yet just working off of > localhost). Then I created the two files, .htaccess and .htpasswd, > using the htpasswd.exe application that comes with Apache (I had to do > it this way becuase you can't create a file with a nameless extension > on the desktop). Finally I created two new filetypes for .htpasswd > and .htaccess so I could open them in notepad. > > The .htpasswd contains a single user (md5 encrypted) and looks like > this: > stone:$apr1$e50.....$szuwghDBUK3q5SBK6gkAM. > > The .htaccess file resides within the subdirectory I want to password > protect and looks like this: > AuthUserFile D:\Program Files\Apache Group\Apache2\.htpasswd > AuthType Basic > AuthName "Member Page" > require valid-user > > All relevant lines in the httpd.cnfg file are: > AccessFileName .htaccess > <Files ~ "^\.ht"> > Order allow,deny > Deny from all > </Files> > > Apache does its job when I attempt to view the .htaccess file I get a > Permission Denied message. But when I browse to the protected > directory where my .htaccess file resides my browser displays the > index page rather than prompting me for a password. > > What am I doing wrong? > > Thanks, > Kevin Stone > |