Solved

Turn off mod_rewrite specific folder

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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

751 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