The Referer directive can be used to force users to enter a document from a specified path instead of jumping in at random. It allows the Webmaster to specify an exact match or wildcard expression to match the Referer: HTTP header. Refer to the OnDeny directive as a way to send the browser to the correct entry point.
![]() |
Note There is nothing to prevent a user from accessing the directory if they are able to modify the Referer: header that is sent with their browser. |
You can use this directive only within Limit sections.
The Referer is a prefix to the standard Allow and Deny directives.
referer deny from URL
referer allow from URL
URL is a wildcard expression that specifies a URL.
access.cfg
The default is to allow all Referer fields.
The following example limits users to entering this directory through the /test/ URLs. The * allows any port number or any directory beyond /test/. The OnDeny directive sends the browser to http://my.server.com/test/.
<Limit GET POST>
order deny,allow
deny from all
referer allow from http://my.server.com:*/test/*
OnDeny http://my.server.com/test/
</Limit>