We help IT Professionals succeed at work.

Stopping mod_rewrite on certain directories?

Medium Priority
Last Modified: 2010-03-04
I have a mod_rewrite script that changes query string URLs into directories. The problem is I just added a real directory, and mod_rewrite confuses it with a query string URL. Is there a way to say if the url is requesting /thisdirectory/ or anything in /thisdirectory/ to just go to that directory?
Watch Question

Top Expert 2008

RewriteRule ^directory  - [L]

above your RewriteRules to skip them.


That makes www.MyDomain.com/directory/ work, but it still doesn't like www.MyDomain.com/directory/admin
Top Expert 2008
The regEx uis open to rthe right side, so it should catch every filepath starting with directory. Do you have othr .htaccess files in place? Check the RewriteLog.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.