Solved

Turn off mod_rewrite specific folder

Posted on 2004-10-01
8
1,093 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
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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

895 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

14 Experts available now in Live!

Get 1:1 Help Now