Thx! I'll give this a try. I found out that the original code was actually working for every subdirectory except for the one I was testing it with, because I already had another htaccess file within the /forums directory. Hours of tweaking, for a 10-second "doh!". But I'm still stuck a bit, because I need that other .htaccess file for a different reason. Here's my current htaccess file in the root folder:
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
And it works fine for all but the forums directory. I have this htaccess file in the /forums directory:
- Code: Select all
RewriteEngine On
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
What that does is rewrite bots coming in at
http://www.domain.com/sitemap.gz to the php code that dynamically generates a sitemap.
The vbseo folks suggested changing the htaccess in the /forums directory to something like this:
- Code: Select all
RewriteEngine On
#RewriteCond %{HTTP_HOST} ^domain.com [NC]
#RewriteRule ^(.*)$ http://www.domain.com/forums/$1 [L,R=301]
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
But it did not work at all; caused a server error. Any advice would be greatly appreciated.