Reputation: 11
How to use 403 forbidden for 1 single page. I have been using the following code below on directory level like on my WordPress site /wp-content/, /wp-includes/ & it works. But How to achieve for a single file like /example-service.html so that when anyone visit the page /example-service.html it returns 403 forbidden (in .htaccess)
<files>
order allow, deny
deny from all
</files>
Upvotes: 1
Views: 600
Reputation: 41219
You can use the following RewriteRule
to redirect /example-service.html
to 403
error.
RewriteEngine On
RewriteRule ^example-service.html$ - [R=403]
Upvotes: 1