My Drupal site is at http://www.websitemaven.com

I created a folder under public_html called tnm

Thus when I type http://www.websitemaven.com/tnm or http://www.websitemaven.com/tnm/ it should take me to the folder on my server. Instead it brings up my search site for a file not found or a path not found.

If I type http://www.websitemaven.com/tnm/index.html then it finds that file in the directory.

How can I change a setting withing Drupal so it doesn't look for that particular link on my site but knows to just let the server handle it?

Comments

cog.rusty’s picture

One way is to edit Drupal's .htaccess file

DirectoryIndex index.php index.html index.htm

So, Drupal will respect directories which contain those index files.

A second similar way is to add a small .htaccess file in that subdirectory, containing the line

DirectoryIndex index.html

This will keep you safe from Drupal updates which may restore Drupal's .htaccess file to how it was.

A third, more radical way is to change the last block of directives in Drupal's .htaccess file from

# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

to

# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-U
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

That should leave alone all existing subdirectories, and if they don't have an index file specified you will just get an Apache "access forbidden" page. If you prefer, you can give those directories a Options +Indexes line, which will display their file listing instead.

See also the handbook for other ways:

http://drupal.org/node/167169 -- for what
http://drupal.org/node/30334 -- how

SemperFideles’s picture

Thanks Rusty. Interestingly, I moved all my Rewrite rules to httpd.conf and tried a RewriteCond that told Apache not to use the RewriteRule for the tnm directory but it didn't work. The .htaccess file in the directory did the trick. I appreciate the help. I understand how to set these up but the syntax always kills me.

Rich Leino
http://www.websitemaven.com