Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-11-25
8
Medium Priority
?
409 Views
Last Modified: 2012-05-10
Hi,

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

Thanks
0
Comment
Question by:peps03
  • 4
  • 3
8 Comments
 
LVL 1

Expert Comment

by:psalkiew
ID: 34212355
Add:

Allowoverride none

directive to <Directory> definition.

0
 

Author Comment

by:peps03
ID: 34212529
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
 
LVL 10

Expert Comment

by:Tobias
ID: 34212577
Dear peps03,

See this page for the explanation :

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

Best Regards
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 1

Accepted Solution

by:
psalkiew earned 1000 total points
ID: 34212579
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
 

Author Comment

by:peps03
ID: 34212781
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
 

Author Closing Comment

by:peps03
ID: 34214289
Thanks psalkiew!

This was the solution that worked!

I had to restart apache AND the browser..

Rookie mistake..

Thanks!
0
 
LVL 1

Expert Comment

by:psalkiew
ID: 34215908
Any changes to httpd.conf require apache restart - this file is parsed only on startup.
0
 

Author Comment

by:peps03
ID: 34216952
i know, i did that. but i also had to restart my browser apparently..

thanks for the help!
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question