Solved

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

Posted on 2010-11-25
8
361 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
Comment Utility
Add:

Allowoverride none

directive to <Directory> definition.

0
 

Author Comment

by:peps03
Comment Utility
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
Comment Utility
Dear peps03,

See this page for the explanation :

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

Best Regards
0
 
LVL 1

Accepted Solution

by:
psalkiew earned 250 total points
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:peps03
Comment Utility
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
Comment Utility
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
Comment Utility
Any changes to httpd.conf require apache restart - this file is parsed only on startup.
0
 

Author Comment

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

thanks for the help!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
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 …
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now