Author |
|
Askviken
Joined: 27 Mar 2007 Posts: 4 Location: Sweden
|
Posted: Tue 27 Mar '07 18:11 Post subject: .htaccess |
|
|
I can't get my .htaccess and .htpasswd to work on my apache server. Do you have to activate something in a config file? I have done the .htaccess and .htpasswd files like http://wiki.apache.org/httpd/Recipes/PasswordBasicAuth says but I don't seem to understand the directory thing.
//Thanks for the help in advance, Filip |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 28 Mar '07 9:40 Post subject: |
|
|
Hello,
you have to enable .htaccess by default it is disabled
AllowOverride None
to
AllowOverride all
e.g.
DocumentRoot "/server2/www"
<Directory "/server2/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory> |
|
Back to top |
|
Askviken
Joined: 27 Mar 2007 Posts: 4 Location: Sweden
|
Posted: Thu 29 Mar '07 21:13 Post subject: |
|
|
thanks alot! I'll try it and see if i get it to work |
|
Back to top |
|
Jorge
Joined: 12 Mar 2006 Posts: 376 Location: Belgium
|
Posted: Thu 29 Mar '07 23:58 Post subject: |
|
|
James Blond wrote: |
AllowOverride None
to
AllowOverride all
|
or
AllowOverride Auth
if you only want to use auth in htaccess files |
|
Back to top |
|
Askviken
Joined: 27 Mar 2007 Posts: 4 Location: Sweden
|
Posted: Fri 30 Mar '07 8:54 Post subject: |
|
|
James Blond wrote: | Hello,
DocumentRoot "/server2/www"
<Directory "/server2/www">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory> |
Where in the httpd.conf is this string located or where do I have to put it ?
Should the <Directory> point to the .htpasswd, .htaccess file or just to the document root ? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 30 Mar '07 9:27 Post subject: |
|
|
DocumentRoot "C:/apache2/htdocs"
<Directory "C:/apache2/htdocs">
There is a code block in your httpd.conf where your doc root is defined.
Also there is a <Directory block where the rules defined for the doc root folder. There you have to change
Jorge wrote: |
AllowOverride None
to
AllowOverride all
or
AllowOverride Auth
if you only want to use auth in htaccess files
|
|
|
Back to top |
|
Askviken
Joined: 27 Mar 2007 Posts: 4 Location: Sweden
|
Posted: Fri 30 Mar '07 17:24 Post subject: |
|
|
Thanks alot for the help! It works as intended now. |
|
Back to top |
|