• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 411
  • Last Modified:

Is there a way to prevent the localhost from reading the .htaccess file?

Hi,

Is there a way to prevent the localhost (my winLAMP testing server) from reading the .htaccess files in the directories?

Thanks
0
peps03
Asked:
peps03
  • 4
  • 3
1 Solution
 
psalkiewCommented:
Add:

Allowoverride none

directive to <Directory> definition.

0
 
peps03Author Commented:
Hi psalkiew!

Thanks for your reply. I found a lot of <Directory> tags..
and some more: "Allowoverride"

Could you be a little more specific? what lines are in front for example?
I have to edit the "httpd.config"-file right?

thanks
0
 
TobiasCommented:
Dear peps03,

See this page for the explanation :

http://httpd.apache.org/docs/2.0/mod/core.html

Best Regards
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
psalkiewCommented:
Yes, you must edit the apache server configuration file (httpd.conf). There you must find Directory definition for the directories in which you want to restrict .htaccess files. For example:

        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

This is the definition of the document root. When you change AllowOverride in this section to none the whole www server will stop reading .htaccess files.

When you have many sites, virtual servers or user directories you must find the appropriate <directory> definition and change the AllowOverride value in desired place.
0
 
peps03Author Commented:
I found it..

But setting "all" to "none" is not working.. the .htaccess files are still followed.

I am running apache on my computer with several folders in the root, each folder contains a website with also a .htaccess file.

thanks
0
 
peps03Author Commented:
Thanks psalkiew!

This was the solution that worked!

I had to restart apache AND the browser..

Rookie mistake..

Thanks!
0
 
psalkiewCommented:
Any changes to httpd.conf require apache restart - this file is parsed only on startup.
0
 
peps03Author Commented:
i know, i did that. but i also had to restart my browser apparently..

thanks for the help!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now