logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: .htaccess
Author
Askviken



Joined: 27 Mar 2007
Posts: 4
Location: Sweden

PostPosted: Tue 27 Mar '07 18:11    Post subject: .htaccess Reply with quote

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

PostPosted: Wed 28 Mar '07 9:40    Post subject: Reply with quote

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

PostPosted: Thu 29 Mar '07 21:13    Post subject: Reply with quote

thanks alot! I'll try it and see if i get it to work Smile
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Thu 29 Mar '07 23:58    Post subject: Reply with quote

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

PostPosted: Fri 30 Mar '07 8:54    Post subject: Reply with quote

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

PostPosted: Fri 30 Mar '07 9:27    Post subject: Reply with quote

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

PostPosted: Fri 30 Mar '07 17:24    Post subject: Reply with quote

Thanks alot for the help! Smile It works as intended now.
Back to top


Reply to topic   Topic: .htaccess View previous topic :: View next topic
Post new topic   Forum Index -> Apache