clarkmurray
IS-IT--Management
Is there a way to code an htaccess file to allow access to a directory only if the request comes from a specific link?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
No request comes from a link. Requests comes from a user agent.clarkmurray said:[gray](...)[/gray] the request comes from a specific link?
[gray]# REMOTE_ADDR[/gray]
<Directory /to/protect>
Order deny,allow
Deny from all
Allow from ok.example.com
</Directory>
[gray]# HTTP_REFERER[/gray]
SetEnvIf Referer ok.example.com granted
<Directory /to/protect>
Order Deny,Allow
Deny from all
Allow from env=granted
</Directory>
# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
Satisfy Any
As I know, such things can be only simulated using mode_rewrite :spewn said:i need to change the DirectoryIndex only if a request comes from a specific website...
RewriteEngine on
RewriteCond %{HTTP_REFERER} [URL unfurl="true"]www.me.com[/URL]
RewriteRule ^$ index1.html