Solved

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

Posted on 2010-11-25
8
396 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:MadShiva
ID: 34212577
Dear peps03,

See this page for the explanation :

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

Best Regards
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 1

Accepted Solution

by:
psalkiew earned 250 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Guacamole and browser performance 1 125
Problem with .htaccess file 4 73
Need to redirect request from IIS server to old Apache Server. 3 157
quoting a comma separated list 20 91
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
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…

749 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