Sub-Directory Exclusion from .htaccess

I am currently attempting to run custom scripts to generate XML Site Maps in the same directory as my Omeka instillation and am running into 404 error pages (naturally becuase Omeka is doing its job correctly) what I need is access to a directory in the instillation folder along with all scripts and sub folders. Eventually I would also like to run cron jobs to automate the generation of site maps through the same directories so I would also need the ability to do so once i have the scripts set up as well (the scripts already have this feature)

Example:

/instdir/sitemap/
/instdir/sitemap/index.php
/instdir/sitemap/sitemap.xml
etc...

I imagine that I would need to edit the .htaccess to allow requests to this folder and its scripts and sub directories but have been unsuccessful. Any idea how I would go about this?

I understand that within the standard .htaccess there is a section that disables access to php files and I assume there is a protocol that handles the redirection to the 404 page as well...

# Omeka .htaccess: Apache configuration file
# This file is required for Omeka to function correctly.

# --------------- #
# Error Reporting #
# --------------- #

# Uncomment the SetEnv line below to turn on detailed on-screen error
# reporting.
#
# Note: This should only be enabled for development or debugging. Keep this
# line commented for production sites.
#
# SetEnv APPLICATION_ENV development

# ------------- #
# Rewrite Rules #
# ------------- #

RewriteEngine on

# If you know mod_rewrite is enabled, but you are still getting mod_rewrite
# errors, uncomment the line below and replace "/" with your base directory.
#
# RewriteBase /

# Allow direct access to files (except PHP files)
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule !\.php$ - [C]
RewriteRule .* - [L]

RewriteRule ^install/.*$ install/install.php [L]
RewriteRule ^admin/.*$ admin/index.php [L]
RewriteRule .* index.php

# -------------- #
# Access Control #
# -------------- #

# Block access to all .ini files.
<FilesMatch "\.ini$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# --------#
# Caching #
# --------#

# Uncomment the lines below in order to enable caching of some files
# (after a finished site has gone live)
#
# <IfModule mod_expires.c>
#    <FilesMatch "\.(js|ico|gif|jpg|png|css)$">
#        ExpiresActive on
#        ExpiresDefault "access plus 10 day"
#    </FilesMatch>
# </IfModule>

# ------------ #
# PHP Settings #
# ------------ #

<IfModule mod_php5.c>
    php_flag register_globals off
    php_flag magic_quotes_gpc off
</IfModule>

Try:

RewriteRule ^sitemap/.*$ - [L]

Put that line right above the one for install.

Would this have the same effect with a folder nested in the theme directory?

It depends on exactly what you want to do.

The default rules will run anything under the Omeka directory though Omeka's PHP code, with direct links to non-PHP files being the only exception.

If you want to have direct access to PHP files somewhere under the Omeka folder structure, you'll have to use some specific rule or condition, like the one I posted above, to exempt that path from the normal rewrites.

Thanks John, I ask because I am in the process of deciding weather I should develop a plugin or extend the simple pages plugin to develop some rich pages to display specific pages with lists of collections that fall into 3 separate categories. I tried creating an index in a subdirectory, but due to the current rules I was getting 404s as php's were not accessable.