How can i exclude a directory from a Drupal installation?

Sometimes you install Drupal in the root of the account. Doing this Drupal manage all the content in the root directory so if you wish install something or put a content in a directory created by you, for example "jon" and try to access the link http://yourdomain.com/jon, it show the drupal "Page not found" error. To avoid this and unlink this directory from the Drupal management simply add the following line in the drupal .htaccess file.

In the following section of the .htaccess content:

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

add the additional rewrite line with the directory name (in the example "jon") you wish to exclude:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} !^/jon/.*$
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Was this answer helpful? 1 Users Found This Useful (1267 Votes)