4

RewriteRule ^folder_name/?$ - [F,L] This blocks access to the folder only; not its contents (because of the trailing end-of-string anchor). And since you have existing mod_rewrite directives, it will need to go near the top, before the existing directives. Generally, you should have blocking directives first. RewriteRule ^folder_name - [F] : remaining ...


2

I found a method that works: RedirectMatch 404 ^/folder_name/.*$


1

Try something like the following instead: RewriteEngine On # Block direct access to __private__ RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule ^__private__ - [F] # Rewrite requests from __staging__ to __private__ RewriteRule ^__staging__(.*) __private__$1 [L] There's no need to set the __staging__ environment variable, unless you are using this for ...


1

This is my blog URL pattern /2015/01/10/post-title/ You need to specifically check for the old URL pattern, otherwise you will naturally redirect everything, including all the new URLs of the "news aggregator site". Try, something like the following instead, at the top of your .htaccess file: RewriteEngine On RewriteRule ^\d{4}/\d\d/\d\d/[\w-]+/$ ...


Only top voted, non community-wiki answers of a minimum length are eligible