1

I have a Wordpress installation that uses permalinks, using mod_rewrite:

mysite.com/wp/post?id=3 becomes mysite.com/cats/furrycat

Now I want to prevent visitors to see posts in mysite.com/notes/. This folder does not exist, as it's just a wordpress category.

How can I block access to /notes/ in the root .htaccess?

SPRBRN
  • 2,406
  • 4
  • 35
  • 48

1 Answers1

2

Above the wordpress rules in the htaccess file in your document root, add:

RewriteRule ^notes/ - [L,F]

These need to be in the file before any of the wordpress rules. This will return a 403 Forbidden if a request is made that starts with /notes/

Jon Lin
  • 142,182
  • 29
  • 220
  • 220