views:

22

answers:

3

I am using Drupal in my website but there are some folders outside drupal. I want to exclude those folders from rewrite rules.

I already tried :

  • RewriteCond %{REQUEST_URI} !^/admin/ in .htaccess
  • Options +MultiViews in apache config
A: 

http://www.howtoforge.com/forums/showthread.php?t=38

RewriteBase?

FractalizeR
+1  A: 

In order to access all existing files:

RewriteCond %{REQUEST_FILENAME} !-f

In order to access all existing directories:

RewriteCond %{REQUEST_FILENAME} !-d

In order to access a specific file called handler.php:

RewriteCond %{REQUEST_URI} !=/handler.php

In order to access a specific directory called images:

RewriteCond %{REQUEST_URI} !=/images
RewriteCond %{REQUEST_URI} !=/images/(.*)

For instance,

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/handler.php
RewriteCond %{REQUEST_URI} !=/images
RewriteCond %{REQUEST_URI} !=/images/(.*)
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Not tested, but should work. Lemme know if you need further help.

Andrew Sledge
A: 

Create a .htaccess inside the folder that you want to break off. Apache will read the root .htaccess file then the folder .htaccess file. So what ever you place in the .htaccess file in the folder will have the last say.

DirectoryIndex index.html

to restore index.html

ErrorDocument 404 default

Restore normal 404 errors

For the most part you can ignore Drupal is in the parent directory.

http://wsmithdesign.wordpress.com/2010/09/06/adding-drupal-to-an-existing-site-allowing-for-existing-content/

To completely disinherit the parent .htaccess you must rewrite all the directives with new values. You can also try RewriteEngine Off in the subdirectory .htaccess if you do not need to use it..

Wayne