
January 16th, 2005, 04:01 AM
|
|
Registered User
|
|
Join Date: Jan 2005
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
trouble using .htaccess to control access to files
I am wanting to control how files are accessed in one of my folders. I want to be able to access www.mysite.com/cgi-bin/program.cgi but only from www.mysite.com/admin/index.html
I don't want to allow access directly by typing in the URL but how you can only access it if you are coming from www.mysite.com/admin/index.html
I have more than one files in the same directly that I want to do that to but with different ext.
Here is what I have tried so far but I don't think that it is all correct.
Code:
<FilesMatch "^prog\.cgi$">
SetEnvIfNoCase Referer "^https://mysite.com/admin/index.html" good_referer=1
order allow,deny
deny from all
allow from env=1
</FilesMatch>
<FilesMatch "^anotherprog\.pl$">
SetEnvIfNoCase Referer "^https://mysite\.com/admin/index.html" good_referer2=2
order allow,deny
deny from all
allow from env=good_referer2
</FilesMatch>
Also my setup
Apache 2.0.52
PHP 4.3.10
Perl 5.8.1
I do have Allowoverride to All in the httpd.conf file for the cgi-bin. I don't know if using the Referer is the best way to go or if I should use the URI instead of the Referer.
Thank You,
Charles
|