Forum Moderators: phranque
A [.htaccess] file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.
what do you mean by "the main site's htaccess overwrites it"?
In the main .htaccess, add exclusions for URL-paths which resolve to to the subdirectory.
-or-
Rearrange the file structure so that interference will no longer occur, using mod_rewrite to map (internally rewrite, not externally redirect) the current URLs to their new file locations.
If the problem is entirely caused by mod_rewrite directives in the root overriding mod_rewrite directives in the subdirectory, then see "RewriteOptions none" as the 'opposite' of "RewriteOptions inherit".
Jim
Depending on what directives you are using, it may not be possible to exclude subdirectories using these methods. But since it's easier than re-arranging your filesystem in accordance with access controls, I thought I'd mention it.
Jim
What would I do here to have it only affect the base directory, and not the subdirectories?
Thanks so much you're a life saver!
Options +FollowSymLinks
# //seo_mod_start
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteRule ^forums.html$ forums.php [L,NE]
RewriteRule ^(.*)-t-([0-9]+).html(.*)$ showthread.php?tid=$2$3 [QSA,L]
RewriteRule ^(.*)-t-([0-9]+)-([0-9]+).html$ showthread.php?tid=$2&page=$3 [QSA,L]
RewriteRule ^(.*)-f-([0-9]+).html(.*)$ forumdisplay.php?fid=$2$3 [QSA,L]
RewriteRule ^(.*)-f-([0-9]+)-([0-9]+).html(.*)$ forumdisplay.php?fid=$2&page=$3 [QSA,L]
RewriteRule ^(.*)-f-([0-9]+)-([a-z]+)(-¦-[a-z]+)-([0-9]+)-([0-9]+).html(.*)$ forumdisplay.php?fid=$2&sortby=$3&order=$4&datecut=$5&page=$6$7 [L]
RewriteRule ^(.*)-a-([0-9]+).html$ announcements.php?aid=$2 [L]
RewriteRule ^(.*)-([0-9]+).html$ member.php?action=profile&uid=$2 [QSA,L]
RewriteRule ^([^/]+)-t-([0-9]+)-([0-9]+)\.html$ showthread.php?tid=$2&page=$3 [QSA,L]
Note also that the literal periods in the URL-path must be escaped as shown.
Best practice: Never use the easy, ambiguous, greedy, and promiscuous pattern ".*" unless it cannot be avoided.
Jim