Deny access to a path (give 403 or 404 response)


I know this should be easy. BBpress creates user profiles at /forums/users/.

I’d like to make them unavailable to anyone, and not be indexed by Google. I’ve tried the following (in .htaccess) and more, but nothing seems to work. Is it because these are not real directories, just a page hierarchy created by BBpress? What’s the solution?

# RedirectMatch 404 ^/fora/users/.*$

# RedirectMatch 404 ^.*/users/.*$

# this give internal server error throughout site:
# <Files ~ "/users/">
# Header set X-Robots-Tag "noindex, nofollow"
# </FilesMatch>

# RewriteEngine on
# RewriteRule ^.*/users/.*$ - [F]
Jim Worrall 4 days 0 Answers 5 views 0

Leave an answer