Solved

Turn off mod_rewrite specific folder

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

12 Experts available now in Live!

Get 1:1 Help Now