Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Turn off mod_rewrite specific folder

Posted on 2004-10-01
8
Medium Priority
?
1,098 Views
Last Modified: 2010-05-22
Hi

Just a quick question. How can I turn off the mod_rewrite module just for one directory on the web server. e.g.

I want mod_rewrite on /home/thisuser/public_html/ so that it allows sites without trailing slash and stuff. But I do not want mod_rewrite on /home/thisuser/public_html/stats/

How can I do this.

Thanks

spyrit
0
Comment
Question by:spyrit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 15

Expert Comment

by:periwinkle
ID: 12202871
I assume that you are actually talking about using specific rules for certain virtual hosts, not actually just allowing it for some directories within a single virtual host.  Set up a separate virtual host for the directories that you require the rules to be in, and put the mod_rewrite statements there.

0
 

Author Comment

by:spyrit
ID: 12204150
Yes - I have virtual hosts and I have it set up on /home/user/public_html/ but I want the /stats/ folder within the public_html to not have the mod_rewrite
0
 
LVL 4

Accepted Solution

by:
TomDavidson earned 200 total points
ID: 12228187
"RewriteEngine off" can, I believe be used in a directory directive and an .htaccess file as long as it has permission from the AllowOverride
0
 

Expert Comment

by:cptnem0
ID: 32822596
I am trying to do the same. How did you do?

Create htaccess file in sub direct with syntax:

<IfModule mod_rewrite.c>
RewriteEngine Off
</IfModule>

?

I tried above, did not work for me.
0
 
LVL 4

Expert Comment

by:TomDavidson
ID: 32824128
It's very possible that apache is not reading your .htaccess file. Try just putting some random characters in and see if it causes a 500 error. If it doesn't then it's most likely that you have an "AllowOverride None" set somewhere up the directory structure; either in .htaccess or somewhere else in apache's configuration as this tells Apache not to allow any changes (so it won't bother to read .htaccess either)
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

670 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