how would i achieve this?
for example to access x.domain.com or its ip address you must be referred by domain.com or its ip address only, otherwise access denied or custom page
i know a method of using php in the file but i would like it to be global
regards
.htaccess require specific referrer?
Moderator: General Moderators
Re: .htaccess require specific referrer?
I'm guessing since you mention.htaccess files you are using Apache? Apache makes available a number of pre-defined variables for use with mod_rewrite one of which is HTTP_REFERER, you could place some rewrite rules within your .htaccess file to redirect all unwanted referrers to a 401, 403, 404 or some such similar page.
Although, refferer headers can be easily spoofed so it not 100% fail safe.
Although, refferer headers can be easily spoofed so it not 100% fail safe.